Question

Apache default page in Django app Ubuntu

Posted September 14, 2017 3.2k views
ApacheDjangoUbuntu 16.04

Hi, i’ve been fighting with my droplet for the last 2 days and a can’t figure out what’s happening because i’m new to VPS. Here’s my problem:
I created a droplet sing Ubuntu 16 32bits. I followed the next tutrorial
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
And this one too
https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04
The problem is with the last one. Everything it’s ok until i get to the apache configuration part, because no matter what i can’t get apache to show anything but the default page when i type the IP address in the browser.
I’m sure it’s a silly error. Here’s my conf file:

<VirtualHost *:80>

        ServerName <some ip>
        DocumentRoot /home/pablo/myproject/myproject
        ServerAdmin webmaster@localhost

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

        Alias /static /home/pablo/myproject/static
        <Directory /home/pablo/myproject/static>
                Require all granted
        </Directory>

        <Directory /home/pablo/myproject/myproject>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>

        WSGIDaemonProcess myproject python-home=/home/pablo/myproject/myprojectenv python-path=/home/pablo/myproject
        WSGIProcessGroup myproject
        WSGIScriptAlias / /home/pablo/myproject/myproject/wsgi.py
</VirtualHost>

As you can see, it is not my Django project, it’s just the tutorial example. I just added the DocumentRoot and the ServerName to see if anything change but nothing happend.

edited by asb

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @Ceibo,

Are you sure your DocumentRoot is /home/pablo/myproject/myproject? I would suspect that’s what’s going on. Apache is trying to fetch a file for you however it can’t find it.

Please make sure all the paths mentioned in your configuration file exist and have the proper permissions/ownership.

If nothing helps, you can check your Access and Error logs to further see if anything interesting will be shown there to help you pinpoint the problem.

Regards,
KDSys

Submit an Answer