apache
<VirtualHost *:80>
ServerName www.test.com
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/phpStudy/WWW/app"
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
nginx
nginx.conf最后一行改为 include vhost/*.conf;
以下为vhost/test.conf
server {
listen 80;
server_name www.test.com;
location / {
root "D:/phpStudy/WWW/app/";
index index.html index.htm index.php;
}
location ~ \.php$ {
root "D:/phpStudy/WWW/app/";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}