Webmasters Stack Exchange is a question and answer site for pro webmasters. 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 have a VDS server and a dedicated IP address. The question is how to add multiple sites in a single domain?
For example I have 3 sites as below:

  • www.company.co
  • www.webdesign.com
  • www.inet.com
share|improve this question
up vote 2 down vote accepted

This is a good tutorial on hosting multiple websites with apache2, note the use of a2ensite command over creating symlinks

http://www.debian-administration.org/articles/412

share|improve this answer
    
very informative tut, tnx. – Alireza Hos Apr 22 '12 at 3:18

In 000-default (usually in /etc/apache2/sites-enabled/000-default)

You can use the VirtualHost tag to separate different sites.

<VirtualHost *:80>
    DocumentRoot /var/www/example1
    ServerName www1.example.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/example2
    ServerName www2.example.com
</VirtualHost>
share|improve this answer

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.