LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache Server (https://www.linuxquestions.org/questions/linux-server-73/apache-server-4175455912/)

sagar666 03-28-2013 09:28 AM

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

TenTenths 03-28-2013 09:38 AM

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

eklavya 03-29-2013 12:13 AM

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,

sagar666 03-31-2013 03:24 AM

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

eklavya 04-01-2013 12:07 AM

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.

sagar666 04-01-2013 12:28 AM

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

eklavya 04-01-2013 09:37 AM

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.


All times are GMT -5. The time now is 08:40 AM.