Запрещено У вас нет прав доступа к этому серверу / на этом сервере (apache2) - PullRequest
0 голосов
/ 15 февраля 2019

Я развернул свое приложение django на Linode и использую apache2 в качестве сервера.Когда я впервые развернул свое приложение, все работало нормально с сервером django по умолчанию, но когда я настроил apache2, я начал получать Запрещено. У вас нет разрешения на доступ к / на этом сервере.Сервер Apache / 2.4.34 (Ubuntu) по адресу 139.162.56.162, порт 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 www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

        Alias /static /home/desmond/bedspaced/static
        <Directory /home/desmond/bedspaced/static>
                Require all granted
        </Directory>

         Alias /media /home/desmond/bedspaced/media
        <Directory /home/desmond/bedspaced/media>
                Require all granted
        </Directory>


        <Directory /home/desmond/bedspaced/bedspaced>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>
       WSGIScriptAlias / /home/desmond/bedspaced/bedspaced/wsgi.py
        WSGIDaemonProcess django_app python-path=/home/desmond/bedspaced python-home=/home/desmond/bedspaced/venv

        WSGIProcessGroup django_app



</VirtualHost>```


...