linux 系统中httpd服务的配置参数

配置httpd服务实质上就是修改httpd服务的配置文件。

1、httpd服务的主要配置文件如下图:

2、httpd服务主配置文件常用的参数及用途

[root@PC1linuxprobe conf]# vim /etc/httpd/conf/httpd.conf

 (httpd服务主配置文件截图)

3、其中 主配置文件中 DocumentRoot参数定义的是 网站数据的保存路径

4、目前网站普遍的首页名称是 index.html,向 /var/www/html目录中写入 index.html文件前的httpd服务首页如下:

5、向 /var/www/html目录中写入默认的首页文件index.html

[root@PC1linuxprobe html]# echo aabb1122 > /var/www/html/index.html

查看写入index.html后首页是否改变,如下:

6、修改httpd服务主配置文件/etc/httpd/conf/httpd.conf,将网站数据的保存路径修改问/home/wwwroot

首先创建目录,并新建首页文件:

[root@PC1linuxprobe html]# mkdir /home/wwwroot
[root@PC1linuxprobe html]# echo xxxxyyyyyyzzzz > /home/wwwroot/index.html

修改主配置文件/etc/httpd/conf/httpd.conf:

7、重新启动httpd服务,验证网站数据存储路径修改后的效果

[root@PC1linuxprobe html]# systemctl restart httpd

8、并没有生效????如下图

9、访问 hhtp://127.0.0.1/index.html页面时,显示权限不足

原文地址:https://www.cnblogs.com/liujiaxin2018/p/14018057.html