我刚刚配置了运行CentOS 6的新VPS,它配备了Apache.
原文链接:https://www.f2er.com/centos/373886.html我想禁用Apache,因为我将使用Nginx.
我知道我可以删除/etc/init.d/中的脚本,但我不想这样做,因为它是系统附带的库存物.我宁愿有一种优雅的方式来禁用该服务.
我以为我可以在/ etc / inittab中放一些东西,但是inittab包含:
# inittab is only used by upstart for the default runlevel. # # ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. # # System initialization is started by /etc/init/rcS.conf # # Individual runlevels are started by /etc/init/rc.conf # # Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf # # Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,# with configuration in /etc/sysconfig/init. # # For information on how to write upstart event handlers,or how # upstart works,see init(5),init(8),and initctl(8). # # Default runlevel. The runlevels used are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser,without NFS (The same as 3,if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:3:initdefault:
这让我相信系统正在快速运行.好吧,我看了,在upstart中禁用服务的正确方法是添加覆盖文件.所以我跑:
% 'manual' > /etc/init/httpd.override
并重启我的服务器.但httpd仍在运行!对此感到困惑,我决定通过运行来检查upstart是init服务
% readlink /proc/1/exe /sbin/init
那不是我期待看到的.也许我毕竟没有跑步.有确切的方法可以检查吗?如果我正在运行init,那么永久禁用服务的推荐方法是什么?我是这一切的新手,似乎有很多相互矛盾的意见.
感谢大家的帮助.