一我注,準(zhǔn)備篇
1按咒,配置網(wǎng)絡(luò)&關(guān)閉SELINUX&配置防火墻
配置網(wǎng)絡(luò)&關(guān)閉SELINUX&配置防火墻
2,創(chuàng)建www用戶(hù)
groupadd www && useradd -g www -s /bin/false www
二但骨,安裝篇
1励七,添加nginx官方y(tǒng)um源
vi /etc/yum.repos.d/nginx.repo
CentOS 6
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=1
enabled=1
CentOS 7
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=1
enabled=1
2,下載nginx簽名密鑰
rpm --import http://nginx.org/keys/nginx_signing.key
3奔缠,yum安裝
yum -y install nginx
4掠抬,啟動(dòng)nginx
CentOS 6
service nginx start
CentOS 7
systemctl start nginx.service
systemctl enable nginx.service
5,狀態(tài)管理命令
CentOS 6
/etc/rc.d/init.d/nginx
service nginx start
service nginx stop
service nginx restart
service nginx condrestart
service nginx try-restart
service nginx force-reload
service nginx upgrade
service nginx reload
service nginx status
service nginx help
service nginx configtest
service nginx check-reload
chkconfig nginx on #啟用開(kāi)機(jī)自啟
chkconfig nginx off #禁用開(kāi)機(jī)自啟
CentOS 7
/usr/lib/systemd/system/nginx.service
systemctl start nginx.service
systemctl stop nginx.service
systemctl restart nginx.service
systemctl reload nginx.service
systemctl status nginx.service
systemctl enable nginx.service #啟用開(kāi)機(jī)自啟
systemctl disable nginx.service #禁用開(kāi)機(jī)自啟
6校哎,相關(guān)軟件目錄及文件位置
/usr/sbin/nginx
/etc/nginx/nginx.conf
/var/lock/subsys/nginx
/var/run/nginx.pid
三两波,優(yōu)化篇
暫無(wú)