Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to configure Apache2 with Django and mod_wsgi on a virtual host.

I wrote a simple configuration file:

<VirtualHost: *.80>

        ServerName gpx
        ServerAlias gpx.gpsfte
        DocumentRoot /var/www/gpx/htdocs

        WSGIScriptAlias / /var/django/gpx/wsgi/mainapp.wsgi


But when I reload Apache I get this error:

# service apache2 reload
apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Syntax error on line 9 of /etc/apache2/sites-enabled/gpx: Expected </VirtualHost:> but saw </VirtualHost>
Action 'configtest' failed.
The Apache error log may have more information.!

I'm really lost, what does it mean with </VirtualHost:>? Thanks for any help you can give me.

share|improve this question
Which line is 237 in your apache2.conf? – RWC Jul 18 '12 at 5:21
up vote 3 down vote accepted

The problem looks like it is with the way you've opened the section: the ending tag that matches <VirtualHost: ...> is </VirtualHost:>, as the error indicates.

Presumably you meant to open the section with the following instead:

<VirtualHost *:80>

(note that there is no colon after VirtualHost)

share|improve this answer
Great, thanks for the answer! – F.C. Jul 18 '12 at 13:58

Assuming this is a web server, your current structure and configuration would look more like this:

<VirtualHost: *:80>
      ServerName       domain.tld
      ServerAlias      sub.domain.tld
      DocumentRoot     /path/to/document/root
      WSGIScriptAlias  /var/django/gpx/wsgi/mainapp.wsgi
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.