进入/etc/init.d/httpd,在任意行插入加入两行内容
# chkconfig: 345 61 61
# description:Apache httpd
[root@end ~]# chkconfig --add httpd
[root@end ~]# chkconfig httpd on 关闭iptables [root@localhost httpd]# iptables -F 清空iptables防火墙策略
[root@localhost httpd]# service iptables stop 关闭防火墙
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost httpd]# chkconfig iptables off 重启后防火墙依旧处于关闭状态
关闭selinux 两种方法
1.使用命令setenforce 0 系统重启即失效(不需要重启)
2.编辑配置文件/etc/sysconfig/selinux 将SELINUX=enforcing改为disabled状态( 须重启生效)
[root@localhost httpd]# setenforce 0 临时将selinux改为Permission状态,重启系统后失效
[root@localhost httpd]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled 将selinux改为disabled状态,需要重启系统才能生效
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted