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 Linode instance of Ubuntu 10.4 using the LAMP stack to host an instance of Magento and a couple other things. I currently have megento set up at:

http://123.459.780.123/magento

When I apply my domain using the Linode tools, I can apply it so that I can access the magento site at:

http://mydomain.com/magento

I would like to host multiple sites, so that I can have /magento, /mysite, /aclientsite all hosted under Apache, but have domains resolve to those paths, so that the root of the individual sites are those, so I can have http://mymagentosite.com, http://mysite.com, and http://aclientsite.com.

I've done this before using tools in GoDaddy, but never using just Ubuntu and ssh access. Can someone explain what I need to do to point domains to folders in Apache? Or at least the correct terms to Google. :)

share|improve this question

migrated from serverfault.com Sep 12 '11 at 19:35

This question came from our site for professional system and network administrators.

    
I removed the Linode tag because this is not relevant to the question. –  Toby Dec 14 '11 at 18:56

1 Answer 1

I'm not familiar with Linode, but all you need to do is point all the domains to server's IP address and leave the remaining for Apache Name-based Virtual Host handle, something like this:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin ...
    DocumentRoot /var/www/html/magento
    ServerName magentosite.com
    ServerAlias www.magentosite.com
    ErrorLog logs/magentosite.error_log

    <Directory "/var/www/html/magento">
        AllowOverride all
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ...
    DocumentRoot /var/www/html/aclientsite
    ServerName aclientsite.com
    ServerAlias www.aclientsite.com
    ErrorLog logs/aclientsite.error_log

    <Directory "/var/www/html/aclientsite">
        AllowOverride all
        Order Allow,Deny
        Allow from all
    </Directory>
</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.