LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about the nameserver? (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-the-nameserver-751685/)

your_shadow03 09-01-2009 01:04 AM

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

bathory 09-01-2009 02:03 AM

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

your_shadow03 09-01-2009 07:16 AM

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?

bathory 09-01-2009 07:31 AM

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.

your_shadow03 09-01-2009 10:13 AM

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.

bathory 09-01-2009 03:47 PM

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.

nuwen52 09-01-2009 04:18 PM

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.

chrism01 09-01-2009 11:09 PM

for RHEL DNS, see http://www.linuxtopia.org/online_boo...5_ch-bind.html

your_shadow03 09-02-2009 03:59 AM

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

bathory 09-02-2009 04:09 AM

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.

teebones 09-02-2009 05:16 AM

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

Thanks


All times are GMT -5. The time now is 06:15 PM.