debian apache2 修改默认路径

1.修改 /etc/apache2/sites-enable/000-default.conf

将DocumentRoot改成你的路径

2.修改 /etc/apache2/apache2.conf

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

将<Directory /var/www/> 改为 <Directory 你的路径>

3.重启apache 服务器

service apache2 restart

可能的问题:

403 Forbiden 或者 You don't have permission to access / on this server

修改你的路径目录权限为可读写

chmod -R 755  你的路径

 

原文地址:https://www.cnblogs.com/calamus/p/10375792.html