Welcome, Guest
Please Login or Register.
Lost Password?
Multi-Domains on Home Web Server - DNS issues? (1 viewing)
Post Reply

TOPIC: Multi-Domains on Home Web Server - DNS issues?

#15877
RainbowViper (User)
Posts: 30
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/24 19:57  
OK, did as suggested. Let the install script install everything, after a bare-bones CentOS install. I made sure "Web Server" was NOT selected, so the installer would install the right Apache itself.

Named the server "server.mydomain.us", set the NIC to 192.168.1.200/255.255.255.0 which is correct for my LAN. Default Gateway of 192.168.1.1 and DNS Servers xx.xx.3.121 and xx.xx.3.122 (My ISP's DNS Servers).

Didn't create any virtual interfaces.

In Virtualmin -> System Settings-> Module Config, I changed "Default IP Address for DNS Records" to my Public IP (12.34.56.78, not 192.168.1.200).

And it worked, as far as actually installing everything.

But once I created the first Virtual Server with Virtualmin, it still insists on resolving to /var/www/html for the Domains, even though in that server's settings, it's set to point to /home/(username)/public_html.

I can fire up www.mydomain.us and it's found right away, but shows me the index.html in /var/www/html. (mydomain.org and .net aren't resolving yet, and probably won't until sometime tomorrow.)

I'm stumped. This is the same result I got when creating everything manually.

Anyone got any bright ideas? I'm all ears.
  The administrator has disabled public write access.
#15887
ronald (User)
Posts: 505
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 01:06  
so you created a domain with mod_fcgid and the /home/mydomain.us was created?
suexec points to /home?
other created domains are also in the /home directory?
how come those doesn't resolve yet as you had them pointing to your server before?

if installation went flawless then default settings should produce a working system.
you need to look into the httpd.conf - section <virtualhost> and see/post what it looks like.
  The administrator has disabled public write access.
#15896
RainbowViper (User)
Posts: 30
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 08:06  
I created everything through Virtualmin.

And the reason they weren't resolving was because the Zone Records aren't being formed right. There must be some value I haven't entered as a default that's causing this. In each record, the first and second occurence of the domain name was the "@" symbol. i.e.
@ SOA IN ns1.mydomain.us. and then
@ IN A 12.34.56.78 and a couple other places, I think.

The mydomain.us record is the ONLY one that contains the additional two lines:

ns1.mydomain.us. IN A 12.34.56.78
ns2.mydomain.us. IN A 12.34.56.78

Otherwise they are identical except for the domain name.

I remember another post where it said that "@" symbol was wrong. I'll go look up the post.

In the meantime, I again hand-edited each Zone Record to correct its syntax. Once I got it correct, all three Domains reolved perfectly and instantly. Also, www.intodns.com agreed that the records were correct. The only warning I got was about having only one IP Number to work with, but those were "Yellow warnings", not "Red warnings".

httpd.conf VirtualHosts section is as follows:

Code:

<VirtualHost 12.34.56.78:80> SuexecUserGroup "#501" "#502" ServerName mydomain.us ServerAlias www.mydomain.us ServerAlias lists.mydomain.us DocumentRoot /home/(account name)/public_html ErrorLog /home/(account name)/logs/error_log CustomLog /home/(account name)/logs/access_log combined ScriptAlias /cgi-bin/ /home/(account name)/cgi-bin/ ScriptAlias /awstats /home/(account name)/cgi-bin DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory /home/(account name)/public_html> Options Indexes IncludesNOEXEC FollowSymLinks allow from all AllowOverride All </Directory> <Directory /home/(account name)/cgi-bin> allow from all </Directory> Alias /dav /home/(account name)/public_html Alias /pipermail /var/lib/mailman/archives/public <Location /dav> DAV On AuthType Basic AuthName mydomain.us AuthUserFile /home/(account name)/etc/dav.digest.passwd Require valid-user ForceType text/plain Satisfy All </Location> <Files awstats.pl> AuthName "mydomain.us statistics" AuthType Basic AuthUserFile /home/(account name)/.awstats-htpasswd require valid-user </Files> RedirectMatch /cgi-bin/mailman/([^/]*)(.*) https://mydomain.us:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 RedirectMatch /mailman/([^/]*)(.*) https://mydomain.us:10000/virtualmin-mailman/unauthenticated/$1.cgi$2 </VirtualHost>



That's typical of all three domains. Where you see 12.34.56.78, my actual dedicated Public IP appears. Where you see (account name), that's replaced by the actual user name I assigned to the Domain. (The usernames were created by Virtmin, too.) Where you see mydomain.us, that's different in each VirtualHost entry and correct in all three sections as mydomain.us mydomain.org and mydomain.net

Yes, suexec points to home:

[root@server /]# suexec -V
-D AP_DOC_ROOT="/home"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=500
-D AP_USERDIR_SUFFIX="public_html"
[root@server /]#

I'm getting more and more baffled, lol.
Thanks for your help.
  The administrator has disabled public write access.
#15906
ronald (User)
Posts: 505
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 11:54  
the <VirtualHost 12.34.56.78:80> should be <VirtualHost 192.168.1.200:80>

apache listens to internal IP and the WAN should be in the dns records.
this can be done under system settings-module config.

in the server template under BIND dns domain you can add
${DOM}. 38400 IN NS ns2.domain.us.
in the big box. Note the . at the end

the zonefile looks like this

$ttl 38400
@ IN SOA ns.domain.us. postmaster.domain.us. (
2008071801
10800
3600
604800
38400 )
@ IN NS ns.domain.us.
domain.us. IN A 12.34.56.78
www.domain.us. IN A 12.34.56.78
ftp.domain.us. IN A 12.34.56.78
m.domain.us. IN A 12.34.56.78
localhost.domain.us. IN A 127.0.0.1
mail.domain.us. IN A 12.34.56.78
domain.us. IN MX 5 mail.domain.us.
domain.us. IN TXT "v=spf1 a mx a:domain.us ip4:12.34.56.78 ?all"
  The administrator has disabled public write access.
#15908
ronald (User)
Posts: 505
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 12:00  
also it doesn't look like you activated mod_fcgid in the server template on creation as that will add following to the directives:

<Directory /home/domain/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/domain/cgi-bin>
allow from all
</Directory>
RemoveHandler .php
RemoveHandler .php5
  The administrator has disabled public write access.
#15911
Joe (Admin)
Posts: 4084
graph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 14:00  
Virtualmin can't tell what the correct IP for your system is. Is this a virtualized system of some sort? (vservers, or its descendants OpenVZ or Virtuozzo, in particular have this problem because they have oddly named and oddly laid out network interfaces)

Just set it correctly in the Module Configuration in the fields labeled "Network interface for virtual addresses" (which should be the "base" interface...like eth0 or eth1, not eth0:1) and "Default virtual server IP address" which is only needed if the IP you want to use as the default is not the IP found on the interface in the prior option.

If you're on a private network, you also have to fill in the next DNS IP field with your public IP.
  The administrator has disabled public write access.
#15916
RainbowViper (User)
Posts: 30
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 18:56  
Well, given what Ronald said, on a hunch I edited httpf.conf directly with vi and replaced 12.34.56.78:80 in all three <VirtualHost> entries with 192.168.1.200:80

And now everything works. Hallelujah! All three domains are now resolving their proper directories of /home/(name)/public_html.

But this brings up the question of why Virtualmin didn't set things correctly to start with. Which leads me to believe I had a wrong address in there somewhere.

I think I'm going to delete all three domains, and try Virtualmin again.

Thank you both for your help. I appreciate it.

I may be back. ;)
  The administrator has disabled public write access.
#15917
RainbowViper (User)
Posts: 30
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 19:06  
Darnit, edit won't work.

Ronald, how do I "enable mod_fcgid"??

And where *exactly* is the template you mention when you said:

"in the server template under BIND dns domain you can add
${DOM}. 38400 IN NS ns2.domain.us.
in the big box. Note the . at the end"

I can find no server template in BIND. What is the "click-path"?
I'm still learning. ;)

Thanks again.
  The administrator has disabled public write access.
#15918
ronald (User)
Posts: 505
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/25 20:41  
virtualmin - system settings - server templates - default settings - Apache website
on that pade 2/3 down, find "Default PHP execution mode"

Also in the dropdown go to BIND dns domain to add the line in the upper box.

If you are going to host domains for others, you might consider cloning the default template and experiment with that one instead of the default one...
  The administrator has disabled public write access.
#15924
RainbowViper (User)
Posts: 30
graphgraph
Re:Multi-Domains on Home Web Server - DNS issues? 2008/08/26 08:24  
Again, thanks. This has been very helpful.

I added the line "${DOM}. 38400 IN NS ns2.domain.us." to the "BIND DNS Domain" (changing the word "domain" to my real domain name).

But on the "virtualmin - system settings - server templates - default settings - Apache website" there is no such checkbox labeled "Default PHP execution mode".

Did you mean that I should simply add the following lines:

AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .php5

to the window titled "Directives and Settings for New Website"??

Because if there's supposed to be a checkbox labeled "Default PHP execution mode" it simply isn't there.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.