Linux中web服务器的默认路径更改

web服务器的默认路径改到/media(或者其它根目录):

1.更改httpd的配置文件

#vi /etc/httpd/conf/httpd.conf

DocumentRoot "/media"

#
# Relax access to content within /var/www.
#
<Directory "/media">
AllowOverride None
# Allow open access:
Require all granted
</Directory>

2.禁用selinux
# setenforce 0

3.重启httpd服务
#systemctl restart httpd

4.验证

firefox http://127.0.0.1