Nginx 服务器搭建

yum源安装nginx (使用源码安装就进行源码的操作,不可混淆)

  • 安装命令
yum install -y nginx
  • 查看关于nginx的所有地址
whereis nginx
  • nginx配制文件(root指向的HTML,user---)
cd /etc/nginx/nginx.conf
  • nginx 页面
cd /usr/share/nginx/html/index.html
  • 查看进程号(默认80,表示已启动)
netstat -tpl
  • 配制文件修改后,重新加载
nginx -s reload
  • 测试文件是否正确
nginx -t
  • 启动nginx
nginx

nginx 卸载

  • 停止nginx
service nginx stop
  • 删除nginx的自动启动
chkconfig nginx off
  • 删除nginx本地文件(根据自己的目录清除)
whereis nginx

rm -rf /usr/---
rm -rf /etc/---
  • yum 清理
yum remove nginx

猜你喜欢

转载自www.cnblogs.com/xinzaiyuan/p/12078575.html