0

I'm trying to install a website built using the Python flask framework. For this I'm following this tutorial. I followed all steps successfully, but when trying to disable the default site and enable mywebsite with the following commands, but I get errors on both commands:

$ sudo a2dissite default
ERROR: Site default does not exist!
$ sudo a2ensite mywebsite.nl
ERROR: Site mywebsite.nl does not exist!

I've got mywebsite.nl in /etc/apache2/sites-available:

ubuntu@ip-xxx-xxx-xxx:/etc/apache2/sites-available$ ls -l
total 16
-rw-r--r-- 1 root root 1332 Jan  7  2014 000-default.conf
-rw-r--r-- 1 root root 6437 Jan  7  2014 default-ssl.conf
-rw-r--r-- 1 root root  335 Jul  7 13:57 mywebsite.nl

and the contents of mywebsite.nl are:

<VirtualHost *:80>
         WSGIDaemonProcess mywebsite
     WSGIScriptAlias / /var/www/mywebsite/app.wsgi

     <Directory /var/www/mywebsite>
            WSGIProcessGroup mywebsite
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
     </Directory>
</VirtualHost>

and the contents of /var/www/mywebsite/app.wsgi are:

import sys
sys.path.insert(0, '/var/www/mywebsite')

import app as application

Since I followed the whole tutorial, I'm kinda unsure where to look for the problem.

Does anybody have a tip on where to start debugging? All tips are welcome!

[EDIT]

From the output of a2ensite and a2dissite below I now understand that 000-default is the current default website to disable. But I don't understand why mywebsite.nl is not there. Any code I need to display here for you guys to understand this?

$ a2ensite
Your choices are: 000-default default-ssl
Which site(s) do you want to enable (wildcards ok)?
^C
$ a2dissite
Your choices are: 000-default
Which site(s) do you want to disable (wildcards ok)?
^C
kramer65
  • 1,394
  • 4
  • 21
  • 43
  • Post the output of the a2ensite and a2dissite commands (without any sudo and without any arguments) – qasdfdsaq Jul 07 '15 at 14:21
  • @qasdfdsaq - Thanks for that. I added the output for `a2ensite` and `a2dissite` to the question. It clearly doesn't find `mywebsite.nl`.. Any ideas how I can debug that? – kramer65 Jul 07 '15 at 14:28
  • Are you *sure* you put your config file in `/etc/apache2/sites-available/` and that it's readable by apache? And are you *sure* apache is actually installed in `/etc/apache2`? Is it an actual AWS VM you are using? – qasdfdsaq Jul 07 '15 at 14:31
  • @qasdfdsaq - I am sure it is an actual AWS VM I'm using (I just signed up and created the VM). I added some more information to the question (source of wsgi file and mywebsite.nl). Does this give you any more info on what could be wrong? – kramer65 Jul 07 '15 at 14:41

1 Answers1

2

Looks like your file has to end with .conf but in your case ends with .nl. Renaming it to mysite.nl.conf should fix it.

qasdfdsaq
  • 6,621
  • 1
  • 26
  • 37