A
A
Askhat Bikmetov2014-02-18 14:53:08
Apache HTTP Server
Askhat Bikmetov, 2014-02-18 14:53:08

How to host multiple domains on one server?

On Ubuntu 12.04 openVZ VPS, Apache is installed, Passanger is installed in it, so that the Ruby site works. The site has several faces available (not yet) at different addresses. I create in /etc/apache2/sites-availablea file site1.com. Having previously created an A record on the site1.com domain referring to the server ip. The content of the file is:

<VirtualHost *:80>
    ServerName site1.com
    DocumentRoot /home/happy_buddha/Sites/rubysite/public
        <Directory /home/happy_buddha/Sites/rubysite/public>
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

Now if you go to site1.com, the content of the browser window is:
8c310095082c43469a8fbb4a93867501.png
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kerman, 2014-02-19
@askhat

You also need to register alias in the Apache config, this is how I did it with redmine:

Alias /redmine "/usr/local/www/redmine/"
<Directory /usr/local/www/redmine>
  PassengerAppRoot /usr/local/www/redmine
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>

S
Sergey Gornostaev, 2014-02-19
@sergey-gornostaev

a2ensitesite1.com

S
Smilley, 2014-02-18
@Smilley

As far as I remember, the config name must end with conf. After you rename - a2ensite site1.com.conf

Z
zxmd, 2014-02-18
@zxmd

Is Passanger installed correctly?
I remember for nginx it must be included separately. And I don’t know these Apaches of yours.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question