下面操作都需要root用户
1,备份amp/account.log (存了mysql密码和ftp密码)
2,删除/alidata/www/*
3, 配置自己的站点(多站点)
1, rm -rf /alidata/www/*
删除phpwind,
2, cd /alidata/server/nginx/conf/vhosts/
网站的配置文件
3, rm -rf phpwind.conf
删除phpwind.conf
4, cp default.conf.bak default.conf
copy 配置文件模版
5, 配置文件(一个站需要一个配置文件)
配置网站的配置文件的规范
[1]所有配置文件必须存在/alidata/server/nginx/conf/vhosts/ 下
[2]网站的域名.conf(不要www.和域名结尾,比如www.127web.com,127web.cof)
[3]default.conf (通过localhost,或者IP 访问);
6,修改站点配置文件
server_name localhost; //域名
index index.html index.htm index.php;//(访问默认文件)
root /alidata/www/default;
//网站的代码目录
log_format 127web '$remote_addr - $remote_user [$time_local] "$request" '//以127web打头的文件名来存放日志
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /alidata/log/nginx/access/default.log 127web;
7 一旦修改配置文件 /alidata/server/nginx/sbin/nginx -s reload
[1]如果出现404,需要检查配置文件里面写的目录是否存在,或者是您的代码是否有在该目录
[2]如果出现403, 需要将目录的拥有者和拥有组修改为www, chown www:www [目录名]
8,如果配置多站点
[注意事项]
1,mysql 密码无效,/etc/my.conf 第五行 skip-grant-tables )(清空密码
2,启动nginx 出现 nginx.pid 无效 ,
1) killall 'nginx'
2)编辑/alidata/server/nginx/logs/nginx.pid 随便定义一个5位数字,然后重启
3,启动nginx 说nginx.pid 文件不存在;
1) killall 'nginx'
2) nginx -c /alidata/server/nginx/logs/nginx.pid