LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-28-2015, 08:52 AM   #1
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Rep: Reputation: Disabled
Apache Host based configuration


Hi,

I want to configure Virtual Host based apache setup.

Below is the configuration of httpd.conf

<VirtualHost 10.193.185.76:80>
ServerAdmin webmaster@simha.blr.asicdesigners.com
DocumentRoot /var/www/html
ServerName simha.blr.asicdesigners.com
ErrorLog logs/simha.blr.asicdesigners.com-error_log
CustomLog logs/simha.blr.asicdesigners.com-access_log common
</VirtualHost>

My machine name is simha1.blr.asicdesigners.com

But i want open a pages when we type http://simha.blr.asicdesigners.com but its not working

but when i type http://simha1.blr.asicdesigners.com in web browser its working. Please help me to resolve this problem.

Details:
OS: RHEL 6.5
firewall disabled
selinux disabled
 
Old 06-29-2015, 12:59 AM   #2
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
from where you can access? machin in local network? because that machin may have hosts record of your server name and ip address and on isp is not configured pointers to your server.
 
Old 06-29-2015, 10:43 AM   #3
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi,

Lan and even local machines also not working
 
Old 06-29-2015, 11:00 AM   #4
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
OK. There may be N number of factors. First you have to say when you try to open page what kind of error you receive, what is written in log files. is your virtual host path pointing to index file where your pages are located to open (/var/www/html).
 
Old 06-29-2015, 11:07 PM   #5
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi

When i type simha1.blr.asicdesigners.com its working fines but for simha.blr.asicdesigners.com having problem

Logs:
tail -f /var/log/httpd/simha.blr.asicdesigners.com-access_log
10.193.190.111 - - [29/Jun/2015:09:12:47 +0530] "GET / HTTP/1.1" 200 50
10.193.190.111 - - [29/Jun/2015:09:12:47 +0530] "GET /favicon.ico HTTP/1.1" 404 304
10.193.190.111 - - [29/Jun/2015:09:12:47 +0530] "GET /favicon.ico HTTP/1.1" 404 304
10.193.190.111 - - [30/Jun/2015:09:21:45 +0530] "GET /index.html HTTP/1.1" 200 50

[root@simha1 ~]# tail -f /var/log/httpd/simha.blr.asicdesigners.com-error_log
[Mon Jun 29 09:12:47 2015] [error] [client 10.193.190.111] File does not exist: /var/www/html/favicon.ico
[Mon Jun 29 09:12:47 2015] [error] [client 10.193.190.111] File does not exist: /var/www/html/favicon.ico

Page error in browser

The connection has timed out

The server at simha.blr.asicdesigners.com is taking too long to respond.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
 
Old 06-30-2015, 12:59 PM   #6
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
Sorry for late reply. how your server connects to internet? simha1.blr.asicdesigners.com this is name of your server and from local network you can access your web server but when you type http://simha.blr.asicdesigners.com to open your site that site must point to your public ip address and if you server is behind nat or firewall you have to redirect your public ip with 80 port to 10.193.185.76:80.
Or I don't understand something? this (simha1.blr.asicdesigners.com) is server's name or sub domain of (blr.asicdesigners.com)?
 
Old 06-30-2015, 09:56 PM   #7
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi Paul,

Our Apache server is for local testing. So we dont require public IP. simha1.blr.asicdesigners.com is machine name (Apache server). When i access simha.blr.asicdesigners.com from web browser It has to display contents under /var/www/html. But its not happening..My requirement is virtual host setup for Apache. there is no firewall blocking since its in our local Lan and also I can access simha1.blr.asicdesigners.com. blr.asicdesigners.com is just a OU in active directory and for me any domain names is fine say www.example.com.
 
Old 07-01-2015, 01:04 AM   #8
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
ok than if you want to open your page from local network you must write record in dns forward zone for simha.blr.asicdesigners.com. your virtual host config looks normal if it is pointing correct path. but disabling selinux and firewall is not solution. it is not hard to make correct labling and set correct boolean for http server and also iptables.

Last edited by paul2015; 07-01-2015 at 01:08 AM.
 
Old 07-01-2015, 05:59 AM   #9
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi Paul2015,

simha1.blr.asicdesigners.com IP is 10.193.1.9 shall i map to simha.blr.asicdesigners.com to different IP say 10.193.1.10?
 
Old 07-01-2015, 06:30 AM   #10
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
that is your question:

simha1.blr.asicdesigners.com IP is 10.193.1.9 shall i map to simha.blr.asicdesigners.com to different IP say 10.193.1.10?

I am sorry but dont understand that or simply answer yes, why not.



why you must map different ip? if you map that different ip dns will resolve that link to different ip addres and if on that different ip addres will not be running your http server than your site will not open. you can change server's ip address. you can also make virtual ip address on your web server so your server will have 2 ip addresses or how many virtual ips you want to configure. than you can create virtual hosts and your dns server can resolve different names to different ip addresses hosted on your server and you can assign them to different virtual hosts. this: simha.asicdesigners.com is active directory domain or whst is it?

and after all write down items what are you doing or what you want to do.
 
Old 07-01-2015, 06:40 AM   #11
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi Paul,

This is testing for redhat cluster. So i have mapped to simha.blr.asicdesigners.com to 10.193.1.10. Please share me the configuration steps or virtual ip address for web server
 
Old 07-01-2015, 06:56 AM   #12
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
cd /etc/sysconfig/network-scripts


cp ifcfg-eth0 ifcfg-eth0:0
cp ifcfg-eth0 ifcfg-eth0:1

and so on

nano ifcfg-eth0:0

DEVICE="eth0:0"
HWADDR="mac address of etho"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=your virtual ip
NETMASK=
GATEWAY=

nano ifcfg-eth0:1

DEVICE="eth0:1"
HWADDR="mac address of eth0"
BOOTPROTO=static
ONBOOT=yes
TYPE="Ethernet"
IPADDR=your virtual ip
NETMASK=
GATEWAY=

service network restart or systemctl restart network
 
Old 07-02-2015, 11:33 PM   #13
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi Paul,

I want setup like one IP different virtual names example 10.193.1.9 is the IP I want access web server using example1.com and example2.com using only 1 IP. Could Please help me on this
 
Old 07-03-2015, 12:14 AM   #14
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
example1.com and example2.com has same content or it is just 2 different names pointing to same site? if so, just configure dns to point both names to your ip address. if you write details not just result you want it will be better

Last edited by paul2015; 07-03-2015 at 12:19 AM.
 
1 members found this post helpful.
Old 07-03-2015, 03:40 AM   #15
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Thank a lot paul its working fine.
 
  


Reply

Tags
apache, linux +, redhat



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
Sendmail Configuration for email routing based on host mvsureshkumar Linux - Server 1 01-22-2013 11:42 AM
RHEL 5 apache name based virtual host not working smch1 Linux - Software 11 07-28-2011 09:33 AM
Name based virtual Host for Apache and Tomcat dinakumar12 Linux - Server 6 06-07-2011 09:12 AM
Name and IP based virtual host in Apache hifun Linux - Newbie 5 06-17-2009 01:06 PM
Name Based virutal host in apache Inexactitude Linux - Networking 9 04-11-2004 10:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:33 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
Open Source Consulting | Domain Registration