#Apache安装#--CentOS6.7下安装Apache服务器

user

雨橙

中国.四川.成都

世界之上、唯有远见、惟爱不变。


CentOS6.7系统环境下安装Apache步骤如下:

安装apache
yum install httpd httpd-devel

修改IP地址
vi /etc/httpd/conf/httpd.conf
#Servername localhost:80 (去掉注释修改ip)

启动apache服务
/etc/init.d/httpd start
或
service httpd start

停止apache服务
/etc/init.d/httpd stop
或
service httpd stop

重启apache服务
/etc/init.d/httpd restart
或
service httpd restart

配置防火墙外网访问80端口
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

重启防火墙
service iptables restart


注:
网站根目录为/var/www/html/.
配置文件/etc/httpd/conf/httpd.conf
其他配置/etc/httpd/conf.d/目录
 
posted at