cenotos安装apache

yum install httpd

配置系统启动时自动启动apache

chkconfig --levels 235 httpd on

启动apache:

/etc/init.d/httpd start

重启

  /etc/init.d/httpd restart

 

停止服务

/etc/init.d/httpd start

新建index.html文件

vi /var/www/html/index.html

录入数据this is a test page

关闭防火墙

service iptables off

浏览

curl localhost/index.html

 

配置文件地址

在CentOS中Apache的默认文档的根目录是/var/www/html,配置文件/etc/httpd/conf/httpd.conf。其他配置存储在/etc/httpd/conf.d/目录里

 

posted on 2014-02-11 17:00  看我的眼神儿  阅读(62)  评论(0)    收藏  举报