LinuxQuestions.org
Visit Jeremy's Blog.
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 03-28-2013, 09:28 AM   #1
sagar666
Member
 
Registered: Feb 2013
Posts: 212

Rep: Reputation: Disabled
Apache Server


Hi,

I configured a Apache Server in redhat 6 .If i enter a url http://example.com/index.html its working fine in configured system , but i want to access same url in other systems that are in Same network. How can i do that ??
 
Old 03-28-2013, 09:38 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,481

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Your other systems will need to resolve example.com to the IP address of your apache server. As you don't give any information about what the other systems are then can't give you more specific instructions.

If they are linux machines then you can make an entry in /etc/hosts on each machine:
Code:
123.123.123.1    example.com
If they are windows machines then c:\windows\system32\drivers\etc\hosts is the file that needs changed.

Of, if you've a DNS server on your network you could create a zone for example.com
 
Old 03-29-2013, 12:13 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
You can configure virtual host on your apache.
http://www.thegeekstuff.com/2011/07/...-virtual-host/

By virtual host, you can give individual url to each project of your htdocs or /var/www/html (wherever you have put your projects).
Example if there are 5 projects in htdocs.
you can access them as projectname1.com, projectname2.com, projectname3.com, projectname4.com & projectname5.com

as well as your LAN's other systems can access these projects by above names,
 
Old 03-31-2013, 03:24 AM   #4
sagar666
Member
 
Registered: Feb 2013
Posts: 212

Original Poster
Rep: Reputation: Disabled
I configured apache server as like bellow

-->yum install http*

-->open the port 80

--> vi /etc/hosts

i added

10.10.3.126 vidyasagar.com #this is server ip and vidyasagar.com is a virtual host name

--->vi /etc/httpd/conf/httpd.conf

i added

<VirtualHost vidyasagar.com:80>
DocumentRoot /var/www/html/vidyasagar.com
ServerName vidyasagar.com
ErrorLog logs/vidyasagar.com_log
CustomLog logs/vidyasagar.com-access_log common
</VirtualHost>
and also i uncommented

NameVirtualHost *:80


--> i created a directory mkdir /var/www/html/vidyasagar.com

--> nex i created a file index.html under vidyasagar.com directory to test it is working fine in my server only that is 10.10.3.126

But i cant access same url i.e http://vidyasagar.com in windows machines


this server running RHEL 6.2

settings i did in windows machine is

c:\windows\system32\drivers\etc\hosts

i added
10.10.3.126 vidyasagar.com

Note we have dns server running in windows machine and also proxy server that is also in windows os .Is anything need to be done in dns server and proxy server to access that url????
 
Old 04-01-2013, 12:07 AM   #5
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Are you sure the contents 10.10.3.126 vidyasagar.com is added in hosts file of windows because by default you just can't edit, paste and save. You have to change the permission of hosts file of windows then you can save it.

Is the windows system in same LAN? I mean windows system should be in server's LAN because if it is outside LAN, you can't open your site using your LAN IP in windows system's hosts file. You have to use a static IP of the server (provided by service provider) for accessing website outside LAN.

Is it running on linux system of same LAN? if not
Have you started apache after editing your apache conf file.
 
Old 04-01-2013, 12:28 AM   #6
sagar666
Member
 
Registered: Feb 2013
Posts: 212

Original Poster
Rep: Reputation: Disabled
--> sure i added a 10.10.3.126 vidyasagar.com in etc\hosts in windows machine

-->My windows machine is in same LAN and also same series 10.10.3.143 and more over am not access outside the network

-->I restarted httpd daemon after i changed apache conf file
 
Old 04-01-2013, 09:37 AM   #7
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
Add following line in your apache conf file below ServerName vidyasagar.com
Code:
ServerAlias vidyasagar.com
Restart apache.

Can you access your site using IP like http://10.10.3.126/vidyasagar.com on windows machine?
If yes then it is virtual host's problem.
Are your sure your windows firewall allows to access virtual host url on window's machine?

What happens when you open your IP 10.10.3.126 on window's machine?
Does it stick on loading and does it show connection time out?
If it shows connection time out then it is firewall problem.
 
  


Reply



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
How to mv compress the apache log without stopping apache server jayakumar01 Linux - Server 1 06-25-2012 03:42 AM
Apache close wait error :Apache stop responding,Server get hangs jsaravana87 Linux - Server 1 06-19-2012 11:49 AM
how to start mysql server & apache server at startup and then tomcat at last at boot sanjay87 Linux - Server 5 06-16-2012 08:19 AM
Tomcat Apache on Apache Web Server? carlosinfl Linux - Server 6 04-27-2012 05:12 AM
apache server redirecting to apache.org? exley Linux - Software 1 03-13-2006 01:02 AM

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

All times are GMT -5. The time now is 03:35 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