Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd June 2012, 03:12
Lucrian Lucrian is offline
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reverse IP point to another website

Hello,

I have CentOS and ISPConfig 3.
I've configured reverse dns at my hosting to be "domain.com".

On the server I have a domain with several sub-domains.
The problem:
Reverse dns at hosting is "domain.com"
If I insert in browser "http://my.ip.address/", the browser display a sub-domain, not the domain.

I mean, I want that "http://my.ip.address/" to go at "www.domain.com", not to "subdomain.domain.com".

IP and (sub)domains were added through ISPConfig.

How can I change this?

Thanks!
Reply With Quote
Sponsored Links
  #2  
Old 3rd June 2012, 10:23
Lucrian Lucrian is offline
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the reason, but not the solution.
For my IP: 1.1.1.1 I have 3 sites:
domain.com
aaa.domain.com
ggg.domain.com

According to Apache, default site is aaa.domain.com
Quote:
Due to the fact that www.example1.com is first in the configuration file, it has the highest priority and can be seen as the default or primary server. That means that if a request is received that does not match one of the specified ServerName directives, it will be served by this first VirtualHost.
So, it's true for my server.

The problem still remain because all virtual hosts are in folder "/etc/httpd/conf/sites-enabled" and all of them starting with 100-(sub)domain.

I've changed 100-domain in 010-domain and was great, but I want to use ISPConfig to continue to administrate that domain.

What can I do?
Reply With Quote
  #3  
Old 3rd June 2012, 11:28
Lucrian Lucrian is offline
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Well done! Maybe somebody will need the solution for this
I let ISPConfig to do it's job in "/etc/httpd/conf/sites-enabled"
I've modified httpd.conf and at the end of the file (above NameVirtualHost *:80) I wrote

Code:
<VirtualHost my.first.ip:80>
    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^my.first.ip$ [NC]
    RewriteRule   ^/(.*)$http://www.first.domain/$1  [R,L]
</VirtualHost>

<VirtualHost my.secondary.ip:80>
    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^my.secondary.ip$ [NC]
    RewriteRule   ^/(.*)$http://www.secondary.domain/$1  [R,L]
</VirtualHost>
Good luck!
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
Local Website Url - 403 Forbidden Salital Installation/Configuration 11 11th August 2011 10:12
I need help to debug a slow website vtapas Server Operation 15 10th August 2011 10:50
new website cannot be located prithwis Installation/Configuration 3 23rd October 2010 11:38
cannot receive emails after made website online llamy General 20 27th December 2007 01:14
Moving /var to a new drive & renaming mount point tdd_topdog Technical 2 12th July 2006 05:10


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


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