系統環境
CentOS 6.4
網絡參數
#hostname
test-server01
#cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:B8:14:4F
TYPE=Ethernet
UUID=efec5440-2810-49f4-9b13-d01bdbc359c6
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.10.50.102
NETMAST=255.255.255.0
GATEWAY=10.10.0.1
安裝
#tar zxflnmp1.1-full.tar.gz && cd lnmp1.1-full && ./centos.sh
防火牆
# iptables -I INPUT -d 10.10.50.102 -p tcp--dport 80 -j ACCEPT
# iptables -I OUTPUT -s 10.10.50.102 -p tcp--sport 80 -j ACCEPT
測試:
http://10.10.50.102/ 測試nginx正常
http://10.10.50.102/phpinfo.php 測試php正常
mysql-u root -p 測試mysql正常
虛擬主機
# sh /root/vhost.sh
配置文件:/usr/local/nginx/conf/vhost/
普通用戶授權設置
網站根目錄授權
#useradd yangmv
#setfacl-m g:yangmv:rwx /home/wwwroot/ 賦予yangmv用戶組權限
nginx配置文件授權
#chgrp yangmv /usr/local/nginx/conf/nginx.conf
#chgrp yangmv /usr/local/nginx/conf/vhost/
#chmod g+w /usr/local/nginx/conf/nginx.conf
#chmod 775 /usr/local/nginx/conf/vhost/
nginx啓動腳本授權
#visudo
%jichuangALL=/etc/rc.d/init.d/nginx start,/etc/rc.d/init.d/nginx stop,/etc/rc.d/init.d/nginx status,/etc/rc.d/init.d/nginxreload
這樣,yangmv用戶組可以對nginx進行管理,需要管理nginx人員加入yangmv用戶組即可