linux 搭建apache 服务器

1、查看apache服务器

/etc/init.d/httpd status

若没有,则使用yum  -y install httpd  安装软件

2、设置开机启动

 chkconfig httpd on

3、启动服务

/etc/init.d/httpd start

4、修改apacke服务配置

vim /etc/httpd/conf/httpd.conf 

其中 DocumentRoot 后面的参数就是WEB网站的路径

备注:

  服务无法启动,可添加服务器/etc/hosts解析,添加如下内容:

  公网ip   主机名

原文地址:https://www.cnblogs.com/workherd/p/7481356.html