Apache vhosts config: Host Name instead of IP Address
- by Johe Green
I have a domain (example.com) hosted at an external provider. I directed the subdomain sub.example.com to my ubuntu server (12.04 with apache2).
On my ubuntu server I have a vhost setup like this. The rest of the config is basically apache 2 standard:
<VirtualHost *:80>
ServerName sub.example.com
ServerAlias sub.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/sub.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
WSGIScriptAlias / /home/application/sub.example.com/wsgi.py
<Directory /home/application/sub.example.com>
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>
</VirtualHost>
When I enter http://sub.example.com in my browser my application shows up fine. But the domain is replaced by the IP address of my server. Do I have to configure my server somewhere else to deliver all its content under my domain sub.example.com?