Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Linux VPS Support

Notices

Reply
 
Thread Tools
  #1  
Old 12-10-2010, 04:36 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Problems with virtualhosts

Hi!

I'm having problems adding new virtual hosts to my VPS container. I have two domains. I configured the private nameservers to maindomain.com (ns1.maindomain.com and ns2.maindomain.com) as required, althought the nameservers are still pointing to nsxxxxhostgator.com because my site is still on a shared hosting account.

Then I configured the nameservers for seconddomain.com as ns1.maindomain.com and ns2.maindomain.com.

I edited my httpd.conf file adding the following:

************************************************** **
#Virtual hosts
Include conf/extra/httpd-vhosts.conf
************************************************** **

And I created the file conf/extra/httpd-vhosts.conf:

************************************************** **
NameVirtualHost seconddomain.com
<VirtualHost *:80>
# General
ServerAdmin myemail@maindomain.com
DocumentRoot /var/www/html/seconddomain.com
ServerName www.seconddomain.com
ServerAlias seconddomain.com

# Logging
ErrorLog logs/seconddomain.com-error_log
CustomLog logs/seconddomain.com-access_log common
</VirtualHost>

NameVirtualHost maindomain.com
<VirtualHost *:80>
# General
ServerAdmin myemail@maindomain.com
DocumentRoot /var/www/html/maindomain.com
ServerName maindomain.com
ServerAlias maindomain.com

# Logging
ErrorLog logs/maindomain.com-error_log
CustomLog logs/maindomain.com-access_log common
</VirtualHost>
************************************************** **

After that, I restarted Apache.

I did this yesterday, and I can't access to seconddomain.com Have I done something wrong? Should I change the nameservers of my maindomain.com to ns1.maindomain.com and ns2.maindomain.com, or is there any other mistake?

Thanks for your help
Reply With Quote
  #2  
Old 12-10-2010, 09:14 AM
quietFinn's Avatar
quietFinn quietFinn is offline
Veteran Croc
 
Join Date: Feb 2005
Posts: 3,558
Default Re: Problems with virtualhosts

Where is the DNS Zone for domain seconddomain.com? You say: "the nameservers are still pointing to nsxxxxhostgator.com" so that means the DNS Zone should be in that server. Is it there?
__________________
quietFinn - netFinn Finland
"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss
Reply With Quote
  #3  
Old 12-10-2010, 09:14 AM
GatorJacob's Avatar
GatorJacob GatorJacob is offline
HostGator Staff
 
Join Date: Apr 2008
Location: Houston
Posts: 7,294
Default Re: Problems with virtualhosts

Hiya!

Have you setup BIND or another DNS service on your VPS to answer DNS queries? This may be the reason it's not responding.
__________________
Jacob P
HostGator.com
Systems Monitoring Supervisor

Reply With Quote
  #4  
Old 12-13-2010, 03:42 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Re: Problems with virtualhosts

Thanks, GatorJacob and QuietFinn for the help, but still doesn't work.

QuietFinn:
The second domain points to the ns1.maindomain.com and ns2.maindomain.com. I registered both of them, but the DNS servers for maindomain.com were in nsxxx.hostgator.com.

Now I have changed it: The DNS for maindomain.com are
NS1.maindomain.com
NS2.maindomain.com
NSxxxx.HOSTGATOR.COM
NSxxxx.HOSTGATOR.COM

maindomain.com works, because the third and fourth work. But seconddomain.com (DNS are NS1.maindomain.com and NS2.maindomain.com) doesn't work.

GatorJacob

No, I haven't setup BIND neither any other service.


Thanks
Reply With Quote
  #5  
Old 12-13-2010, 04:57 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: Problems with virtualhosts

Quote:
Originally Posted by mcipress View Post
I have two domains. I configured the private nameservers to maindomain.com (ns1.maindomain.com and ns2.maindomain.com) as required, althought the nameservers are still pointing to nsxxxxhostgator.com because my site is still on a shared hosting account.

Then I configured the nameservers for seconddomain.com as ns1.maindomain.com and ns2.maindomain.com.

I did this yesterday, and I can't access to seconddomain.com
Quote:
Originally Posted by GatorJacob View Post
Have you setup BIND or another DNS service on your VPS to answer DNS queries?
1. Purchase / register domain name at domain name registrar
2. Set at least 2 nameservers you wish to use at the domain name registrar
3. Configure your DNS server with an appropriate DNS zone file and records
4. Configure web server with relevant domain name information

Looks like your problem is at number 3.

If you set the nameservers for a domain name at your domain name registrar, e.g. ns1.mydomain.com & ns2.mydomain.com, then you must have a DNS server that serves the DNS records for the mydomain.com zone somewhere. If not it can't work.

Assuming you are moving from your shared account, then you will need to setup BIND or similar DNS service on your VPS, or use a 3rd party DNS service.

If you have a VPS with WHM/Cpanel, this is all very straight forward, otherwise you need to know your way around using the command line.... do you have such experience?
__________________
- David
Reply With Quote
  #6  
Old 12-13-2010, 05:20 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Re: Problems with virtualhosts

Thanks, striddy.

Yes, I assume that's the problem. I haven't done before, so I'll try with some tutorial on Internet and, if I'm too stupid to understand it, I'll ask for cpanel.

Thanks for your help.

If someone knows a good tutorial...
Reply With Quote
  #7  
Old 12-13-2010, 06:37 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Re: Problems with virtualhosts

I created the file /var/named/maindomain.com.db

$ttl 172800
maindomain.com. IN SOA ns1.maindomain.com. webmaster.maindomain.com. (

2010121305 ; Serial in YYYYMMDDXX (XX is increment)
10800; refresh seconds
3600; retry
604800; expire
38400; minimum
);

maindomain.com. IN A xxx.xxx.xxx.198

maindomain.com. IN NS ns1.maindomain.com.
maindomain.com. IN NS ns2.maindomain.com.
maindomain.com. IN MX 1 mail.maindomain.com.

ns1.maindomain.com. IN A xxx.xxx.xxx.198
ns2.maindomain.com. IN A xxx.xxx.xxx.199

www IN CNAME maindomain.com.
ftp IN CNAME maindomain.com.
mail IN A xxx.xxx.xxx.198


And also the named.conf file:
options {
query-source port 53;
query-source-v6 port 53;

directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";
};

zone "maindomain.com" {
type master;
file "/var/named/maindomain.com.db";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};


I run "rndc reload" and "service named reload" (both ok) and...


It still doesn't work
Reply With Quote
  #8  
Old 12-13-2010, 08:48 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: Problems with virtualhosts

Quote:
Originally Posted by mcipress View Post
It still doesn't work
Check at your domain name registrar that you have both nameservers and the correct IP's registered.

If you give us the domain name, it's much easier to help you.
__________________
- David
Reply With Quote
  #9  
Old 12-13-2010, 09:11 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Re: Problems with virtualhosts

Thanks a lot.

Let's forget the seconddomain. The main domain is mcinl.com

On the domain registrar the DNS zone is ns1.mcinl.com, ns2.mcinl.com.

Named is running.

Configuration:
named.conf

options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
query-source port 53;
query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";

};

zone "mcinl.com" {
type master;
file "/var/named/mcinl.com.db";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};


var/named/mcinl.com.db:
options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
query-source port 53;
query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";

};

zone "ugazine.net" {
type master;
file "/var/named/ugazine.net.db";
};

zone "mcinl.com" {
type master;
file "/var/named/mcinl.com.db";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};


On Apache:

NameVirtualHost mcinl.com
<VirtualHost *:80>
# General
ServerAdmin javier.mansilla@mcipress.fi
DocumentRoot /var/www/html/mcinl.com
ServerName mcinl.com
ServerAlias www.mcinl.com

# Logging
ErrorLog logs/mcinl.com-error_log
CustomLog logs/mcinl.com-access_log common
</VirtualHost>




Thanks again!!
Reply With Quote
  #10  
Old 12-13-2010, 10:03 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: Problems with virtualhosts

Any firewall blocking port 53?

http://www.intodns.com/mcinl.com
__________________
- David
Reply With Quote
  #11  
Old 12-13-2010, 10:17 AM
GatorJacob's Avatar
GatorJacob GatorJacob is offline
HostGator Staff
 
Join Date: Apr 2008
Location: Houston
Posts: 7,294
Default Re: Problems with virtualhosts

Hi!

I logged into your VPS and checked out named. It's running, however it's not setup fully yet.

http://tldp.org/LDP/lame/LAME/linux-...me-server.html

Run through that, and make sure you setup named.conf in /etc.
__________________
Jacob P
HostGator.com
Systems Monitoring Supervisor

Reply With Quote
  #12  
Old 12-14-2010, 02:09 AM
mcipress mcipress is offline
Hatchling Croc
 
Join Date: Dec 2010
Posts: 6
Default Re: Problems with virtualhosts

Hi!

Thanks striddy and GatorJacob, you are the best! Now it works, but I have learnt the lesson: I need Cpanel or a constant attention from people like you, and I think I only have right to the first option.

I suppose I'll need some help even with Cpanel installed, but only for small issues.

Thanks again to both of you!
Reply With Quote
Reply

Bookmarks

Thread Tools

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
Some problems... Naruto-Empires Shared Hosting Support 4 08-12-2009 09:13 PM
Problems.... SDP Shared Hosting Support 7 11-26-2007 05:44 PM
no problems here! bubba Customer Reviews 0 12-10-2004 05:59 PM
Do we have problems britbob Network Status 42 11-16-2004 09:05 AM

All times are GMT -5. The time now is 11:57 PM.