Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there a way to host multiple domains with Apache web server without making any changes to the DNS server? I have full control over the Apache server and no control over the DNS server.

share|improve this question
add comment

migrated from stackoverflow.com Nov 18 '11 at 9:02

This question came from our site for professional and enthusiast programmers.

2 Answers

Do the DNS records for those domains all point to your Apache server? If so, then the answer is yes. If all of the domains should serve the same content, then there's nothing more you need to do. If you want them to serve different content, then you need to set up name-based virtual hosts.

If the domains don't resolve to an IP address of your Apache server, then you need the cooperation of the servers where they are currently pointing to, to proxy (or failing that, redirect) the requests to your server. Otherwise, your server will never see the requests, and there's nothing to be done.

share|improve this answer
add comment

Figured it out. I use django with mod_wsgi, and this is how I ended up getting it to work

NameVirtualHost *:80

<VirtualHost *:80>
ServerName b2m1.int.---.com
WSGIScriptAlias / "C:/portal/django.wsgi"
Alias /static/ "C:/portal/inspections/static/"

<Directory "C:/portal/">
Order deny,allow
Allow from all
</Directory>
</VirtualHost>

NameVirtualHost *:8000

<VirtualHost *:8000>
ServerName b2m1.int.---.com
WSGIScriptAlias / "C:/dailyplanning/django.wsgi"
Alias /static/ "C:/dailyplanning/plans/static/"

<Directory "C:/dailyplanning/">
Order deny,allow
Allow from all
</Directory>

</VirtualHost>

NameVirtualHost *:8080

<VirtualHost *:8080>
ServerName b2m1.int.---.com
DocumentRoot "C:/portal/redirect/"

<Directory "C:/portal/">
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
share|improve this answer
add comment

Your Answer

 
discard

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.