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

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
andreychek

Howdy,

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 :-)

https://www.virtualmin.com/documentation/id,troubleshooting_common_probl...

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

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 67.216.104.94 as the default virtual server ip instead of 192.168.1.10, 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

http://pastebin.com/m1a3ed234

Thank you for responding to my post.

Tue, 12/01/2009 - 10:28
ronald
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
coreymanshack

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 67.216.104.94, let's display /home/gatesofanrah.com/public_html/DIRECTORY INDEX"

apache thoughts... "hey they are asking for zapphost.com on 67.216.104.94, 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

http://pastebin.com/m57085268

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

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

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

Tue, 12/01/2009 - 10:46
coreymanshack

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
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 67.216.104.94 for apache

Tue, 12/01/2009 - 10:50
coreymanshack

Ok I set it to use 67.216.104.94 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
ronald's picture

restarting Apache should do it though

Tue, 12/01/2009 - 10:56
coreymanshack

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 67.216.104.94 >.>

Tue, 12/01/2009 - 11:03
ronald
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)
coreymanshack

Yea I went back in and set everything to use the local ip 192.168.1.10 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
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
coreymanshack

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..

http://pastebin.com/m8b42c3d

Tue, 12/01/2009 - 11:38
ronald
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 192.168.1.10

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

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

Tue, 12/01/2009 - 11:48
coreymanshack

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
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
coreymanshack

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