6

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 Magento 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://example.com/magento.

I would like to host multiple sites, so that I can have /magento, /mysite, and /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://exampleA.com, http://exampleB.com and http://exampleC.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?

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

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

10

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.