# 查看默认的运行级别,Debian系默认运行级别为2,Redhat系默认运行级别为3
[11:34:29.9] root@webserver:/usr/local/webserver/nginx# runlevel
[11:34:31.8] N 2webserverwebserver
#运行开机启动项管理器,详细截图见sysv-rc-conf.png
[13:01:32.4] root@webserver:~# sysv-rc-conf
#可以看到存在一些不必要的启动服务,其中包含apache,该服务与nginx冲突
#确保rc.local服务在runlevel2被启用
#之前推测,nginx的https服务和kerio mailserver的https服务相冲突.结合了需求,该WebServer不会挂其他https站点.保留kerio mailserver,重新编译nginx,去掉https选项
[14:13:45.5] root@webserver:~/download/nginx-0.7.61# ./configure –user=www –group=www –prefix=/usr/local/webserver/nginx –with-http_stub_status_module
[14:14:04.9] root@webserver:~/download/nginx-0.7.61# make
#关闭有冲突的Apache Service
[13:07:10.1] root@webserver:~# /etc/init.d/apache2 stop
#关闭进程,重新安装nginx
[00:16:02.5] root@webserver:~# killall nginx
[00:16:12.6] root@webserver:~# cd /root/download
[00:16:28.7] root@webserver:~/download# cd nginx-0.7.61
[00:16:34.0] root@webserver:~/download/nginx-0.7.61# make install
[00:18:28.7] root@webserver:/usr/local/webserver/nginx/conf# nginx
#启动,测试rc.local是否成功执行
[00:26:00.2] root@webserver:/usr/local/webserver/nginx/conf# reboot
#查看nginx和php进程是否启动
[00:29:42.8] root@webserver:~# ps -aux|grep ngin
[00:29:55.9] www 6401 0.0 0.2 14764 11672 ? S 00:28 0:00 nginx: worker process
[00:29:55.9] root@webserver:~# ps -aux|grep php
[00:29:59.9] root 6256 0.0 0.0 88624 3708 ? Ss 00:28 0:00 /usr/local/webserver/php/bin/php-cgi –fpm –fpm-config /usr/local/webserver/php/etc/php-fpm.conf
#陷阱1
The Mysterious — MARK –
All newbie admins asks what this means in /var/log/messages:
Jul 1 16:04:53 windbag — MARK –
Jul 1 16:24:53 windbag — MARK –
Jul 1 16:44:53 windbag — MARK –
That’s just the syslog daemon letting you know that it is alive and well. You may set the interval to anything you like on Debian by editing /etc/init.d/sysklogd. This sets it to 60 minutes:
SYSLOGD=”-m 60″
Then restart the syslog daemon:
# /etc/init.d/sysklogd restart
On Red Hat and derivatives, edit /etc/sysconfig/syslog :
SYSLOGD_OPTIONS=”-m 60″
Restart syslogd with service syslog restart. Then watch it happen in realtime on any Linux with tail -f /var/log/messages. (You can monitor the changes in any text file with tail.)
#陷阱2
exiting due to signal 15
yslogd: exiting on signal 15 这个看上去是syslogd正常的退出信息
no comment untill now