Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd March 2011, 14:58
hhhhhh hhhhhh is offline
Member
 
Join Date: Sep 2008
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
Default Question: How to set up multiple websites in single IP

Hello,

I was trying to configure the apache2, reading apache website, many tutorials and I think that I have all done, but one of the 2 domains configured doesn't run.

I have domain1.com and domain2.com
domain1.com runs perfectly, but when I try the domain2.com it goes to domain1.com

Could you help me?

Here is the code inside the sites-available folder:

Code:
NameVirtualHost 12.345.67.89:80
<VirtualHost www.domain1.com:80>
        ServerAdmin info@domain1.com
        ServerName www.domain1.com
        ServerAlias domain1.com
        DocumentRoot /var/www_domain1/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www_domain1/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error-domain1.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access-domain1.log combined
        ServerSignature On

</VirtualHost>

<VirtualHost www.domain2.com:80>
        ServerAdmin info@domain2.com
        ServerName www.domain2.com
        ServerAlias domain2.com
        DocumentRoot /var/www_domain2/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www_domain2/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error-domain2.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access-domain2.log combined
        ServerSignature On

</VirtualHost>
Awaiting your news.
Thx
Reply With Quote
Sponsored Links
  #2  
Old 3rd March 2011, 18:22
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Please try
Code:
<VirtualHost 12.345.67.89:80>
instead of
Code:
<VirtualHost www.domain1.com:80>
and
Code:
<VirtualHost www.domain2.com:80>
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
hhhhhh (5th March 2011)
  #3  
Old 5th March 2011, 14:44
hhhhhh hhhhhh is offline
Member
 
Join Date: Sep 2008
Posts: 36
Thanks: 10
Thanked 0 Times in 0 Posts
 
Default

Thank you falko!
It works!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Operations in Unix Shell pkrumins Programming/Scripts 1 5th December 2008 01:23
Hosting multiple Websites on my server mick02 Installation/Configuration 7 21st May 2008 11:35
newbie ububtu 6.0.6 error PHP binary line 816 davidsky73 Installation/Configuration 8 17th September 2006 12:51
Simple question... I think - re: multiple domains. lidocayne Installation/Configuration 1 17th July 2006 12:53
Users and websites aren't created Glorfindel Installation/Configuration 9 23rd February 2006 05:20


All times are GMT +2. The time now is 05:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.