19 posts / 0 new
Last post
#1 Tue, 12/01/2009 - 08:49

DNS problems

Why is it, when I point my domain to my ip, I get my main web page instead of the websites page.

Here is the config for the website that is showing the main website...

SuexecUserGroup "#1004" "#1005" ServerName gatesofanrah.com ServerAlias www.gatesofanrah.com ServerAlias webmail.gatesofanrah.com ServerAlias admin.gatesofanrah.com ServerAlias lists.gatesofanrah.com DocumentRoot /home/gatesofanrah.com/public_html ErrorLog /var/log/virtualmin/gatesofanrah.com_error_log CustomLog /var/log/virtualmin/gatesofanrah.com_access_log combined ScriptAlias /cgi-bin/ /home/gatesofanrah.com/cgi-bin/ ScriptAlias /awstats /home/gatesofanrah.com/cgi-bin DirectoryIndex index.html index.htm index.php index.php4 index.php5 Options -Indexes +IncludesNOEXEC +FollowSymLinks allow from all AllowOverride All allow from all RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.gatesofanrah.com RewriteRule ^(.) https://gatesofanrah.com:20000/ [R] RewriteCond %{HTTP_HOST} =admin.gatesofanrah.com RewriteRule ^(.) https://gatesofanrah.com:10000/ [R] Alias /dav /home/gatesofanrah.com/public_html Alias /pipermail /var/lib/mailman/archives/public DAV On AuthType Basic AuthName gatesofanrah.com AuthUserFile /home/gatesofanrah.com/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All RewriteEngine off AuthName "gatesofanrah.com statistics" AuthType Basic AuthUserFile /home/gatesofanrah.com/.awstats-htpasswd require valid-user RedirectMatch /cgi-bin/mailman/([^/])(.) https://gatesofanrah.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 RedirectMatch /mailman/([^/])(.) https://gatesofanrah.com:10000/virtualmin-mailman/unauthenticated/$1.cgi$2

zapphost.com is the main website.... why is it showing zapphost.com on gatesofanrah.com?

Tue, 12/01/2009 - 09:30


There could be a couple of issues that could lead to what you're seeing... take a peek at this and we can work from there :-)


Tue, 12/01/2009 - 10:18 (Reply to #2)

I already took a peak.. it was showing the correct websites before i deleted both vhosts and recreated them. This is a fresh install of virtualmin. All I've done is create gatesofanrah.com delete it, and then recreate it.

Under network settings I set it to use as the default virtual server ip instead of, and I set it up to use full name under defaults for new domains ie 'gatesofanrah.com' for user creation instead of partial ie 'gatesofanrah'.

I have not modified the apache config manually.

Virtualmin Module Configuration under the Other Server Settings category, I could not find this...

Here is my apache2.conf


Thank you for responding to my post.

Tue, 12/01/2009 - 10:28
ronald's picture

if zapphost is the first domain in the sites-enabled than it would make sense that it would show up. Apache just looks at the first site it encounters and that is usually the first site listed.

recreating the gatesofanrah probably made it second in the list.

Tue, 12/01/2009 - 10:45

No, my server was displaying zapphost.com correctly, and gatesofanrah.com correctly by just pointing the domain to my servers ip. This SHOULD be working, it should be using the domain to decide what page is served..

apache thoughts... "hey they are asking for gatesofanrah.com on, let's display /home/gatesofanrah.com/public_html/DIRECTORY INDEX"

apache thoughts... "hey they are asking for zapphost.com on, let's display /home/zapphost.com/public_html/DIRECTORY INDEX"

Does virtualmin not install mod_vhost_alias? If I remember correctly this is what allows apache to think like this. If not or there are no alternatives, I'm going to be switching control panels, cause that is rather stupid that clients HAVE to use my nameservers.

zapphost.com is the fully qualified domain name for the server.

Here is zapphost.com.conf


I noticed zapphost.com.conf is still using the old settings as the vhost directive. gatesofanrah.com.conf is using the new setting i input

Tue, 12/01/2009 - 10:44
ronald's picture

ah i misunderstood, i though you tried to reach the server by IP.
Why is zapphost on a LAN IP < VirtualHost> in the config and gatesofanrah not?

Tue, 12/01/2009 - 10:46

it is on that because when virtualmin was configured, it used my lan ip for the default... it warned me i should set it to wan and I did.... would setting that to wan ip maybe fix my probs?

Tue, 12/01/2009 - 10:50
ronald's picture

apache listens to 1 address. having 2 sites on two different IP's is asking for problems (its not totally true as I use 3 IP's for different sites but then it needs to be configured for that).

if you are not behind NAT then you should use the reachable IP which is for apache

Tue, 12/01/2009 - 10:50

Ok I set it to use on zapphost.com.conf and i rebooted, it will take ~3 mins for my server to reboot it has to rebuild something for raid 1 everytime >.>

Tue, 12/01/2009 - 10:51
ronald's picture

restarting Apache should do it though

Tue, 12/01/2009 - 10:56

yea, i always have problems restarting apache, it acts like apache is already running and it never shutdown and it starts a bunch of apache processes and i have to killall.. its a big mess... rebooting is easier....

Now all I'm getting is "It Works". From both domains after i set zapphost.com.conf vhost to use >.>

Tue, 12/01/2009 - 11:03
ronald's picture

Im getting the right page for gatesofanrah, just a permission denied now. There are a few threads about that in the forum though.

Tue, 12/01/2009 - 11:18 (Reply to #12)

Yea I went back in and set everything to use the local ip and rebooted, why is this working?

and can you point me to the thread about permission denied?

I've uploaded files to the correct directory, it shouldn't be trying to access a directory with nothing in it.

Tue, 12/01/2009 - 11:29
ronald's picture

per haps your server is working as a router too? You need to check out the networking config and related modules. In principle there shouldn't be a mention of a LAN IP if you are directly contected to the web.
The permission denied is probably a deny all in the apache config and may go away when a index is placed.

is this a dedicated server that you first configured at home?
I didn't see a Listen directive in your config so Apache will listen to anything probably which is worse.

Tue, 12/01/2009 - 11:36

this is a server at my house, it is behind a router and i've port forwarded all need ports to this machine... i have an index.php in the public_html directory of gatesofanrah.com

I added this to get phpmyadmin working on all sites, let me fix it.. i can tell i did some things wrong..


Tue, 12/01/2009 - 11:38
ronald's picture

Ah I thought it was at a datacenter since you configured the WAN address.
In that case, yes Apache needs to listen to your LAN IP and both domains must be configured to

Then under virtualmin go to system settings-module config-network settings and set Default virtual server IP address to
set Default IP address for DNS records to

the permission denied may have to do with apache not knowing where to go in your current configuration.

Tue, 12/01/2009 - 11:48

apache seems to know where to get zapphost.com ... why doesn't it know where to get gatesofanrah.com ... i fixed my alias.conf ... thats the only other thing i edited.... here it is http://pastebin.com/m3dc6a30b

If I try to go to gatesofanrah.com/index.php it says it doesnt exist, but I know it does.

Scratch that, thought I had the files uploaded, but I dont... lmfao... uploading now!

Tue, 12/01/2009 - 11:51
ronald's picture

gatesofanrah is probably pointed to a different location, e.g. not to /home/gatesofanrah/public_html

did you set your server as a DMZ host in your router too? Is there anything exciting in your logs?

Tue, 12/01/2009 - 11:53

I was retarded... deleted the files in the directory and forgot about it... i uploaded the files now everything is working great.. thank you for your help ronald! I'm sure I'll have more questions in the future.

Topic locked