设置Apache2 VHost

时间:2017-11-16 00:57:47

标签: apache ubuntu vhosts httpforbiddenhandler

我试图在最新版本的Ubuntu中设置一个apache2 vhost,并且我不断得到一个" Forbidden"在尝试访问该页面时。

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

这是sites-avaliable中的我的vhost文件(是的,我也启用了它)

<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

我尝试了一切,但我仍然被禁止,任何想法?

1 个答案:

答案 0 :(得分:0)

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

您的权限错误

Understanding and Using File Permissions

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