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

将DocumentRoot改成你的路径

debian apache2 修改默认路径

 

 

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

 

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

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

debian apache2 修改默认路径

 

3.重启apache 服务器

 

service apache2 restart

可能的问题:

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

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

 

chmod -R 755  你的路径

 

 

相关文章:

  • 2021-05-05
  • 2021-05-24
  • 2021-06-02
  • 2021-08-17
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2022-01-20
  • 2021-07-04
  • 2021-11-05
  • 2021-12-15
  • 2021-11-07
  • 2021-10-14
  • 2021-11-08
相关资源
相似解决方案