Forum Moderators: phranque

Message Too Old, No Replies

Two DNSs. Both Stuck Going to One. Why?

httpd.conf sections posted - what could be wrong?

         

ewenss

12:15 am on Dec 21, 2011 (gmt 0)

10+ Year Member



I have IP-based virtual hosting and am running CentOS 6.2.

The server has two IP addresses (123.45.678.90 and 123.45.678.900) which resolve to the names domain1name.org and domain2name.org respectively. domain1name.org is run on Moodle, while domain2name.org has only an index.html file.

I have followed everything at [httpd.apache.org...] - or so I think.

Yet both domain1name.org and domain2name.org keep serving domain1name.org.

Both document root permissions are 755.

For the life of me I cannot figure out what could be wrong. I'm hoping someone one might be so kind as to have a look and offer me advice.

Running apachectl -S yields:

VirtualHost configuration:
123.45.678.90:80 domain1name.org (/etc/httpd/conf/httpd.conf:1098)
123.45.678.900:80 domain2name.org (/etc/httpd/conf/httpd.conf:1019)
wildcard NameVirtualHosts and _default_ servers:
_default_:443 domain1name.vpshost.com (/etc/httpd/conf.d/ssl.conf:74)
Syntax OK


I have also tried it yielding this configuration:

VirtualHost configuration:
123.45.678.90:80 is a NameVirtualHost
default server domain1name.org (/etc/httpd/conf/httpd.conf:1096)
port 80 namevhost domain1name.org (/etc/httpd/conf/httpd.conf:1096)
123.45.678.900:80 is a NameVirtualHost
default server domain2name.org (/etc/httpd/conf/httpd.conf:1017)
port 80 namevhost domain2name.org (/etc/httpd/conf/httpd.conf:1017)
wildcard NameVirtualHosts and _default_ servers:
_default_:443 domain1name.vpshost.com (/etc/httpd/conf.d/ssl.conf:74)
Syntax OK


+++++++++++++++++++++++++++++++++++++++++
Current httpd.conf is
+++++++++++++++++++++++++++++++++++++++++

#domain1name.org
Listen 123.45.678.90:80
#domain2name.org
Listen 123.45.678.900:80


(I have also tired just Listen 80)

Cont'd:

Include conf.d/*.conf


(Goes to "/etc/httpd/conf.d")

Cont'd:

# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www/html">
#
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
#
</Directory>
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
#domain1name.org
#NameVirtualHost 123.45.678.90:80
#domain2name.org
#NameVirtualHost 123.45.678.900:80
#
HostnameLookups Off
#
<VirtualHost 123.45.678.90:80>
SuexecUserGroup "#500" "#500"
ServerName domain1name.org
ServerAlias www.domain1name.org
DocumentRoot /home/domain1name/public_html
ErrorLog /var/log/virtualmin/domain1name.org_error_log
CustomLog /var/log/virtualmin/domain1name.org_access_log combined
ScriptAlias /cgi-bin/ /home/domain1name/cgi-bin/
ScriptAlias /awstats/ /home/domain1name/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain1name/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/domain1name/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/domain1name/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/domain1name/cgi-bin>
allow from all
</Directory>
</VirtualHost>

#
<VirtualHost 123.45.678.900:80>
DocumentRoot /home/domain2name/public_html
ServerName domain2name.org
ServerAlias www.domain2name.org
ErrorLog /var/log/virtualmin/domain2name.org_error_log
CustomLog /var/log/virtualmin/domain2name.org_access_log combined
</VirtualHost>


Any ideas of what might be wrong? I'm stumped.

lucy24

12:25 am on Dec 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Quick question: Your example IPs are of course made up. But is any part of IP#2 really contained within IP#1 as in your examples? (Like final .123 and final .12)

btw, if you do a quick Forums search you will understand why the very name /awstats/ right now is enough to make many readers' blood run cold :)

ewenss

12:45 am on Dec 21, 2011 (gmt 0)

10+ Year Member



Hi Lucy. Thanks for your reply.

Everywhere you see the # sign they share the same number:

###.##.###.209
###.##.###.90

Only the last set of numbers differ, as shown.

ewenss

7:31 pm on Dec 21, 2011 (gmt 0)

10+ Year Member



I have still not come up with a solution, but here is some more info that my be helpful to the puzzle:

ifconfig yields info that both IPs are running on the server (IPs replaced with # signs):

lo    Link encap:Local Loopback 
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1614 errors:0 dropped:0 overruns:0 frame:0
TX packets:1614 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:131670 (128.5 KiB) TX bytes:131670 (128.5 KiB)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:67531 errors:0 dropped:0 overruns:0 frame:0
TX packets:85909 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5796078 (5.5 MiB) TX bytes:94580832 (90.1 MiB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:###.##.###.209 P-t-P:###.##.###.209 Bcast:###.##.###.209 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:###.##.###.90 P-t-P:###.##.###.90 Bcast:###.##.###.90 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1


Also, I can access both sites directly by IP, just not the DNS.