LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 04-04-2012, 09:24 AM   #1
Gruszka1
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Rep: Reputation: Disabled
CentOS 6.2 - subdomain doesn't work and problems with making VirtualHost


I've got some serious problems with my vServer. I've been working on that for over 3 days with no results. I'm working on CentOS 6.2 (LAMP). The problem is that subdomains doesn't work for me. I'm using bind9 as a DNS service and my server is supposed to be my master DNS. As a slave server I use a free service at 42.pl website. When I ping my domain grucha.eu it returns correct ip address but subdomains doesn't work. Also www.grucha.eu doesn't. Does anyone has any solution for that? Here is my domain zone configuration:

Code:
$TTL 3600 ;   Default TTL
grucha.eu.      IN SOA   fns1.42.pl. vps.grucha.eu (
                         2012040411 ; serial number
                         3600       ; (refresh)
                         900        ; (retry)
                         360000     ; (expire)
                         3600       ;  TTL
)

$ORIGIN grucha.eu
                IN MX 0 mail.grucha.eu.
                IN NS   fns1.42.pl.
                IN NS   fns2.42.pl.
grucha.eu.      IN A    78.47.154.246
www             IN CNAME grucha.eu.
vps             IN CNAME grucha.eu.
mail            IN CNAME grucha.eu.
subdomena       IN CNAME grucha.eu.
Webhosting company which provides me domain has a panel where I can configure DNS1 and DNS2. I directed both dns1 and dns2 into fns1.42.pl and fns2.42.pl. And at that website (42.pl) I configured an IP address which their dns server should point to. That's the only thing I can set up in there.
 
Old 04-05-2012, 12:54 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Hi,
Quote:
When I ping my domain grucha.eu it returns correct ip address but subdomains doesn't work. Also www.grucha.eu doesn't.
I guess you've already fixed it, as it works from here:
Code:
nslookup www.grucha.eu
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
www.grucha.eu   canonical name = grucha.eu.
Name:   grucha.eu
Address: 78.47.154.246
If this is not what you expect, please clarify

Regards
 
Old 04-05-2012, 01:33 PM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
What I have is the zone defined like:
Code:
$ORIGIN .
$TTL 86400      ; 1 day
example.com          IN SOA  ns.example.com. info.example.com. (
                                2011111111 ; serial
                                7200       ; refresh (2 hours)
                                3600       ; retry (1 hour)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      ns.example.com.
                        NS      ns.example.net.

                        A       1.2.3.3

                        MX      10 mail.example.com.
mail                    A       1.2.3.4
ns                      A       1.2.3.3
subdomain                  A       1.2.3.4

service                 A       1.2.3.5
www                     A       1.2.3.3
try get rid of CNAMEs.

good luck
 
Old 04-05-2012, 05:01 PM   #4
Gruszka1
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Yeah, it works now. The reason why it didn't work was that my main domain was doubled because of one line and my DNS server was interpreting that as subdomain.grucha.eu.grucha.eu...

it works fine right now and it looks like that:

Code:
$TTL 3600 ;   Default TTL
grucha.eu.      IN SOA   fns1.42.pl. vps.grucha.eu (
                         2012040411 ; serial number
                         3600       ; (refresh)
                         900        ; (retry)
                         360000     ; (expire)
                         3600       ;  TTL
)

$ORIGIN grucha.eu.
                IN MX 0 mail.grucha.eu.
                IN NS   fns1.42.pl.
                IN NS   fns2.42.pl.
                IN A    78.47.154.246
www             IN CNAME grucha.eu.
vps             IN CNAME grucha.eu.
mail            IN CNAME grucha.eu.
subdomena       IN CNAME grucha.eu.
As you can see I fixed two things. First was changing
Code:
grucha.eu. IN A 78.47.154.246
for
Code:
IN A 78.47.154.246
and the second one was missing dot after grucha.eu in line:
Code:
$ORIGIN grucha.eu
Thanks everyone for help!

I've got another question about fstab. I would like to mount automatically /dev ; devpts, /proc and tmpfs into my chroot directory but I don't know how to do that. Whenever I reboot my machine, I have to mount them manually. Anyone has any solution for that? For example I want to automount from fstab /dev into /lala/la2/chroot. I know how to do that manually from the command prompt but I don't understand how should it look like by using fstab. Also I would like to automount from my fstab vsftpd users into virtualhosts. My vsftpd users are in /home/user_name/ but my virtualhosts are (let's say) in /somecatalog/something/sudbomain.domain.com. My friend told me that it's a safer way than making symlinks into that folders. Anyone got any clue?Oh and that /home/user_name/ and also /somecatalog/something/subdomain.domain.com are both located inside the chroot environment /lala/la2/chroot so for example virtualhost is inside: /lala/la2/chroot/somecatalog/something/subdomain.domain.com

Last edited by Gruszka1; 04-05-2012 at 05:08 PM.
 
Old 04-07-2012, 04:28 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
I've got another question about fstab. I would like to mount automatically /dev ; devpts, /proc and tmpfs into my chroot directory but I don't know how to do that. Whenever I reboot my machine, I have to mount them manually. Anyone has any solution for that? For example I want to automount from fstab /dev into /lala/la2/chroot. I know how to do that manually from the command prompt but I don't understand how should it look like by using fstab. Also I would like to automount from my fstab vsftpd users into virtualhosts. My vsftpd users are in /home/user_name/ but my virtualhosts are (let's say) in /somecatalog/something/sudbomain.domain.com. My friend told me that it's a safer way than making symlinks into that folders. Anyone got any clue?Oh and that /home/user_name/ and also /somecatalog/something/subdomain.domain.com are both located inside the chroot environment /lala/la2/chroot so for example virtualhost is inside: /lala/la2/chroot/somecatalog/something/subdomain.domain.com
Better start a new thread about this issue.
I don't know if you can use automount to do what you want, but if I were you, I'd put the commands you use to mount those pseudofilesystems in /etc/rc.local, so they'll execute on boot after everything else is up and running

Regards

Last edited by bathory; 04-07-2012 at 04:36 AM. Reason: typo
 
Old 04-07-2012, 09:50 AM   #6
Gruszka1
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok, thanks. I will make a new thread and also test that method with executing on boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Centos] Gksu doesn't work. flowers Linux - Software 2 10-20-2011 08:15 PM
CentOS 6 x86_64 Live CD doesn't work at all! ario Linux - Distributions 3 09-01-2011 04:46 PM
subdomain redirection problem with virtualhost jhwilliams Linux - Networking 2 05-21-2008 06:21 PM
Apache2 VirtualHost Syntax OK but domain still doesn't work bg108 Linux - Server 11 04-18-2008 01:54 PM
making a .htpasswd doesn't work basilogics Linux - Security 6 06-30-2005 05:18 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration