# Apache 相关参数 ![image-20210624115453585](https://panfeng-biji.oss-cn-beijing.aliyuncs.com/img/image-20210624115453585.png) ![image-20210624115528153](https://panfeng-biji.oss-cn-beijing.aliyuncs.com/img/image-20210624115528153.png) 第1步:动手安装 Apache 服务程序。注意,使用 yum 命令进行安装时,跟在命令后面的 Apache 服务的软件包名称为 httpd。如果直接执行 yum install apache 命令,则系统会报错 ``` yum install httpd -y ``` 默认情况下apache默认站点目录为:/var/www/html ``` echo "lbwnb" >/var/www/html/index.html #讲内容写入默认首页 ``` 重启httpd服务 ``` systemctl restart httpd ``` 更改网站默认目录 1.新建网站目录 ``` mkdir -p /opt/www/html #递归创建 ``` 2.新建首页测试文件 ``` echo "测试" >/opt/www/html/index.html ``` 3.修改主配置文件,更为网站路径,将主配置文件第119行和第124行路径更改为/opt/www/html: ![image-20210427100533202](https://panfeng-biji.oss-cn-beijing.aliyuncs.com/img/image-20210427100533202.png) ``` [root@pf ~]# systemctl disable firewalld.service #开机禁用防火墙 [root@pf ~]# systemctl stop firewalld.service #关闭防火墙服务 ```
最后修改:2021 年 11 月 25 日
如果觉得我的文章对你有用,欢迎打赏