Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For using my Debian VPS for multiple domains , I did such actions:

removed the default one from sites-enabled/ and sites-available/ (config and the symbolic link) and I added this under sites-available/www.mysite.com :

<VirtualHost MYIP:80>
ServerName mysite.com
ServerAlias www.mysite.com
Alias /media/ /home/myuser/mysite/media/
Alias /admin_media/ /home/myuser/django/Django-1.2/django/contrib/admin/media/
WSGIScriptAlias / /home/myuser/mysite/wsgi.py
ErrorLog  /home/myuser/mysite/logs/error.log
CustomLog /home/myuser/mysite/logs/access.log combined
</VirtualHost>

And I have changed my ports.conf to:

NameVirtualHost MYIP:80
Listen 80

<IfModule mod_ssl.c>
    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
    Listen 443
</IfModule>

Lastly I enabled the new domain via the command:

a2ensite www.mysite.com

After restart I get this error:

myuser:~# /etc/init.d/apache2 restart
Restarting web server: apache2apache2: Syntax error on line 281 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/sites-enabled/www.birertek.com: /etc/apache2/sites-enabled/www.birertek.com:1: <VirtualHost> was not closed.
 failed!

Please help this poor soul.

share|improve this question
add comment

2 Answers

The file /etc/apache2/sites-enabled/www.birertek.com contains the configuration for the virtual host www.birertek.com.

The file should begin with

<VirtualHost>

which should be followed by various configuration options. There should be a closing

</VirtualHost>

at the bottom.

Check that there is a suitably placed </VirtualHost>

share|improve this answer
add comment

This error:

[...] <VirtualHost> was not closed.

seems to be about your config being improperly formatted. Are you sure you didn't miss some slash/spelling mistake in the actual config? The provided snippet looks OK though, so I'm not sure why you would have something like this. By the way, what DocumentRoot are you using for your virtual hosts?

share|improve this answer
add comment

Your Answer

 
discard

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