0

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 [email protected]
ServerName example.com
ServerAlias example.com
ProxyPass / http://example.com:8822/
ProxyPassReverse / http://example.com:8822/
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
  • What is the result of ls /etc/apache2/sites-available/? Try creating a file called /var/www/html/index.html and see if that is the actual location of your default website. I would guess that you still have the default config file in place.
    – krowe
    Dec 30, 2014 at 10:45
  • apart from example.com.conf sites-available includes 000-default.conf and default-ssl.conf files. And this is the actual location of the default website.
    – xpanta
    Dec 30, 2014 at 11:01

1 Answer 1

1

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 www.example.com
</VirtualHost>

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .