centos7.3安裝Nginx

首先,若是是阿里雲的centos的話,去阿里雲管理端爲80端口設置一組訪問規則,由於阿里雲默認是不開的python

1. 添加Nginx yum 資源庫nginx

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2. 下載Nginxcentos

yum install -y nginx

3. 啓動Nginx瀏覽器

systemctl start/restart/stop nginx.service

4. 測試是否安裝成功tcp

瀏覽器輸入
  http:/127.0.0.1/
出現welcome to Nginx的歡迎頁面表示安裝成功
若是,訪問不了,查看防火牆和端口
  firewall-cmd --zone=public --add-port=80/tcp --permanent
  firewall-cmd --reload  # 更新防火牆配置

5. Nginx經常使用命令測試

nginx -v    # nginx版本
nginx -V    # nginx版本,編譯器版本,配置參數 

 


摘自:阿里雲

  https://blog.csdn.net/dawn_moon/article/details/76018984.net

  https://blog.csdn.net/love__coder/article/details/6587922rest


Endcode

相關文章
相關標籤/搜索