Apache2 still shows default page after trying to configure it

Someone has set Apache2 (ubuntu 14.04) to load the default page at this address: example.com:8822. I checked /etc/apache2/apache2.conf and /etc/apache2/ports.conf and saw no reference to port 8822. So, I went on to to creating my website like this:

sudo vim /etc/apache2/sites-available/example.com.conf

<VirtualHost *:80>
ServerAdmin
ServerName example.com
ServerAlias example.com
ProxyPass /
ProxyPassReverse /
WSGIScriptAlias / /home/chris/project/project/wsgi.py
Alias /static/ /home/chris/project/project/staticfiles/
ErrorLog ${APACHE_LOG_DIR}/error_project.log
CustomLog ${APACHE_LOG_DIR}/access_project.log combined
<Location "/static/">
Options -Indexes
</Location>
</VirtualHost>

and finally

sudo a2ensite example.com.conf

and

sudo a2dissite 000-default.conf

and

sudo service apache2 reload

Now, in sites-enabled there is only one entry to example.com.

However, when loading example.com:8822 it shows the default apache2 web page.

What am I doing wrong?

2

1 Answer

The default configuration file for Apache will provide a definition for your default website. It's files will be at /var/www/html/. If you don't want that site to show up then you need to remove its configuration file (rm /etc/apache2/sites-available/000-default.conf).

One more thing that you'll want to do is fix your new file. I strongly suggest that you begin simple and work your way up. Try this one first:

<VirtualHost *:80> DocumentRoot /www/example1 ServerName
</VirtualHost>

You'll notice that your configuration doesn't include a DocumentRoot. This directive is very important for each vhost.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like