0

我正在尝试在最新版本的 Ubuntu 中设置 apache2 vhost,并且在尝试访问该页面时不断收到“禁止访问”。

我已经为这个新站点设置了一个文件夹,它 /root/websites/panel.joosh.eu/www 的所有者/组是root:root这样我可以编辑它和权限 644

这是我的虚拟主机文件sites-avaliable(是的,我也启用了它)

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    ServerName panel.joosh.eu

    ServerAdmin josh@joosh.eu
    DocumentRoot /root/websites/panel.joosh.eu/www

    <Directory /root/websites/panel.joosh.eu/www>
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>


    ErrorLog /root/websites/panel.joosh.eu/logs/error.log
    CustomLog /root/websites/panel.joosh.eu/logs/access.log combined

我已经尝试了一切,但我仍然被禁止,有什么想法吗?

4

1 回答 1

0
sudo chown -R www-data:www-data /root/websites/panel.joosh.eu/www  

你的许可是错误的

了解和使用文件权限

将您的项目文件夹移动到 /var/www/html 并尝试

于 2018-12-05T06:05:36.853 回答