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

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

2 Answers 2

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. –  web designer 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.