如果你是在使用nginx做为你的主机.那么你要添加一个虚拟主机.如下添加红色为例.这个现在用的人还不是很多.但也为了自己以后留下一个笔记.
如果你的自动安装的程序那么这个配置文件是在.
root@ptubuntu:/etc/nginx/sites-available#vi default
# You may add here your
# server {
# …
# }
# statements for each of your virtual hostsserver {
listen 80;
server_name ls.ptubuntu.com localhost;access_log /var/log/nginx/localhost.access.log;
location / {
root /var/www/nginx-default;
index index.php index.html index.htm;
}location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}location /images {
root /usr/share;
autoindex on;
}#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}
#location ~ \.php$ {
#proxy_pass http://127.0.0.1;
#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
}#
#location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
#includefastcgi_params;
#}# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
#
#location ~ /\.ht {
#deny all;
#}
}server {
listen 80;
server_name nginx.ptubuntu.comcn;location / {
root /var/www/nginx-default/ptubuntu;
index index.php index.html index.shtml;
}
}
#}
所要添加的就是上面这个nginx.ptubuntu.com为你的域名.
原创文章,转载请注明: 转载自PT Ubuntu Blog