Centos7安裝nignx
安裝epel源,默認源有好多軟件無法安裝
sudo yum install epel-release
安裝nignx
sudo yum install nginx
啓動nignx
sudo systemctl start nginx
關閉nignx
sudo systemctl enable nginx
加入開機啓動
sudo systemctl enable nginx
服務配置
- 服務器根路徑 /usr/share/nginx/html
- 默認配置文件路徑 /etc/nginx/conf.d/default.conf
- 虛擬服務器配置路徑 /etc/nginx/conf.d/*.conf
- 全局配置路徑 /etc/nginx/nginx.conf