I need “/var/www” but Apache2 try to use an empty “/var/www/html”

后端 未结 2 1012
耶瑟儿~
耶瑟儿~ 2021-02-09 12:03

This days I sleep with my http://localhost working, and reading pages from /var/www...

I woke up with an "AH00094" error at Apache2

相关标签:
2条回答
  • 2021-02-09 12:30

    See here:

    Why has the apache2 www dir been moved to /var/www/html?

    The default directory apparently (we were also surprised) moved from /var/www to /var/www/html for htdocs in Debian, and Ubuntu copied this change. The reasons given are somewhat sound, but the upgrade path is probably “interesting” (as in the Chinese proverb)… as you have encountered.

    0 讨论(0)
  • 2021-02-09 12:52

    If you want to use /www as root folder instead of /www/html you can simply edit the apache2 config file to have /var/www

    Edit 000-default.conf

    sudo gedit /etc/apache2/sites-available/000-default.conf
    

    then change

    DocumentRoot /var/www/html 
    

    to

    DocumentRoot /var/www
    

    Restart apache2 server :

    sudo service apache2 restart
    
    0 讨论(0)
提交回复
热议问题