LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2009, 02:04 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Rep: Reputation: 51
Question about the nameserver?


I have a RHEL Server where I want to run two website alphaweb.com and gammaweb.com. I configured Apache Server including :

Code:
nameserver 10.14.236.99

<VirtualHost  *>
ServerName  alphaweb.com
ServerRoot localhost
DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost  *>
ServerName  gammaweb.com
ServerRoot localhost
DocumentRoot /var/www/
</VirtualHost>
Is the above configuration sufficient?
What settings I need to make in /etc/hosts or DNS entry so that coleagues can browse the website through alphaweb.com and gammaweb.com??
 
Old 09-01-2009, 03:03 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,605

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
Hi,

If you want others to be able to visit your sites, you need a dns that can resolve the domain names to your server's IP. If you're only interested for this to be done in a LAN you can use the hosts file of your clients.
From the apache side, the "nameserver 10.14.236.99" is wrong. You need to add:
Code:
NameVirtualHost *
Also "ServerRoot localhost" is wrong, but also don't need to define a ServerRoot
 
Old 09-01-2009, 08:16 AM   #3
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Let me explain what I am doing:
[code]

Code:
DocumentRoot "/var/www/html"
I created two webpage at
Code:
touch /var/www/html/index.php
touch /var/www/html/test/index.php
chown -R apache:apache /var/www/
Code:
vi /etc/httpd/conf/httpd.conf
Code:
NameVirtualHost 10.14.1.73
<VirtualHost 10.14.1.73>
    DocumentRoot /var/www/html/test
    ServerName alpha.groupinfra.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost 10.14.1.73>
    DocumentRoot /var/www/html
    ServerName beta.groupinfra.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
I just want to see if the website gets open whenever I type :
Code:
http://alpha.groupinfra.com
Am I doing wrong?

Now If I do http://10.14.1.73 it opens up the page under /var/www/html/test/index.php.
I know that its name-based VirtualHosting but how Can I make it work under the name host?What entry shall i need to edit under DNS?

Last edited by your_shadow03; 09-01-2009 at 08:20 AM.
 
Old 09-01-2009, 08:31 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,605

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
Your apache config is OK. It's normal that http://10.14.1.73 points to the 1st vhost.
You can do your tests by editing /etc/hosts (or c:\Windows\system32\drivers\etc\hosts in Windows) in your client and adding
10.14.1.73 alpha.groupinfra.com
10.14.1.73 beta.groupinfra.com
If you have your own dns server you should create 2 domains: alpha.groupinfra.com, beta.groupinfra.com with each one pointing to the above IP address.
 
Old 09-01-2009, 11:13 AM   #5
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Here in our corporate, Window Admin have already setup DNS and ADS before I joined this company. What I can do is I have few Linux Machine. How Can I setup my own DNS and make it work rather than manual entry coz I want around 10 people access the same So it would be fine if I can setup my own DNS.
Please help me setting up DNS so that I can browse both the webpage.
 
Old 09-01-2009, 04:47 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,605

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
There tons of howtos about configuring bind.
Since you're using RHEL, take a look at this one written for Fedora. In your case, you need to define 2 zones (alpha.groupinfra.com and beta.groupinfra.com), so you have to create 2 zone files. Also the reverse zone is not necessary and don't forget to change the IPs of the howto, to match your network.
 
Old 09-01-2009, 05:18 PM   #7
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
Maybe I'm missing an important point. And, if I am, no need to reply, just ignore...

Anyway, if your windows systems admin has already got a windows DNS server, I'd just talk to them and get them to route both of those addresses (alpha.groupinfra.com and beta.groupinfra.com) to your RHEL computer. Then, use their DNS server to resolve addresses.

Just a thought.

Last edited by nuwen52; 09-01-2009 at 05:20 PM.
 
Old 09-02-2009, 12:09 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
for RHEL DNS, see http://www.linuxtopia.org/online_boo...5_ch-bind.html
 
Old 09-02-2009, 04:59 AM   #9
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,461
Blog Entries: 6

Original Poster
Rep: Reputation: 51
I have made an entry in /etc/hosts:
Code:
10.14.1.73  alphaweb.com alpha
10.14.1.73  gammaweb.com alpha
Now Whenever I open :
http://alphaweb.com
[/code]
It opens the webpage pertaining to
Code:
/var/www/html/test/index.php.
How Can I modify it so that it gets index.php open up with alphaweb.com and index2.php to open with gammaweb.com
 
Old 09-02-2009, 05:09 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,605

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
Well, I guess gammaweb.com took the place of beta.groupinfra.com. Anyway, to do what you want, you have to use
Code:
DirectoryIndex index2.php
in the definition of the gammaweb.com vhost.
 
Old 09-02-2009, 06:16 AM   #11
teebones
Member
 
Registered: Aug 2005
Location: /home/teebones
Distribution: sometimes this, sometimes that..
Posts: 502

Rep: Reputation: 56
to MODS: this thread should be moved to either -> Linux Networking section, OR -> Linux Server section

Thanks
 
  


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
Name resolution with no nameserver indicated priceda332 Linux - Newbie 2 05-05-2009 09:09 AM
nameserver linux_2007_ Linux - Networking 4 03-18-2007 11:56 PM
which is my nameserver. bruse Linux - Networking 3 07-16-2005 02:45 AM
nameserver question r.stiltskin Linux - Networking 4 08-11-2004 04:46 AM
secondary nameserver dilberim82 Linux - Networking 2 10-24-2001 07:47 AM


All times are GMT -5. The time now is 08:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration