Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

apache access using host name

Posted on 2007-04-01
10
Medium Priority
?
822 Views
Last Modified: 2010-05-18
Hai,
I am using wamp server (php+apche+mysql) in windowsxp in local  system, i want to access my system in my LAN  using system name.
For example
http://localhost/  instead of
 http://system name




0
Comment
Question by:cybersoftt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 6

Expert Comment

by:deresh
ID: 18834781
you can do this already. by default apache listens ond localhost. But you can do this only on machine where wamp is installed.
0
 
LVL 32

Expert Comment

by:and235100
ID: 18834926
As deresh implies - "localhost" is the loopback address - i.e. 127.0.0.1

If you use this address on any other domain pc - you most likely will get no page at all.

you need to go to http://<ip_address> (or as you have said http://system)
0
 

Author Comment

by:cybersoftt
ID: 18835102
Hi,
i am accessing webpages like http://localhost ot http://127.0.0.1 it's working.
But i want to access webpage in  my Lan so that system also Wamp is installed.
so i try to access my system using system name(eg.my  system name: Bala)
so
http://bala/ it's not working , what i do to access this way.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 32

Expert Comment

by:and235100
ID: 18835233
What about - as I said:

http://<ip address>
0
 
LVL 6

Expert Comment

by:deresh
ID: 18835262
you need to have some kind of dns servise running on your LAN, because apache does DNS lookups for that nam, but not for netbios or as you have said system name.

but you could easily "fake" dns on your local network:

open C:\WINDOWS\system32\drivers\etc\hosts with text editor and put bala after localhost like this:

127.0.0.1 localhost bala

and then save this file. now you can access http://bala from your computer ( where wamp is installed)

for other computers on your lan to have access to http://bala you will need to put this line in theirs  C:\WINDOWS\system32\drivers\etc\hosts :


192.168.0.1 bala


if your local lan adress for bala ( computer that has wamp installed) is different from 192.168.0.1 then put that address instead.



0
 
LVL 15

Expert Comment

by:samri
ID: 18835389
hi cybersoft,

localhost on any machine that uses TCP/IP would always refer to the local machine that you are currently physically logged on.  This is the "fake" DNS name for 127.0.0.1  This is sometimes called loopback address.  This is required for TCP/IP protocol to fuction properly on a machine.  This address/name would always refer to local machine.

more information on this.
http://en.wikipedia.org/wiki/127.0.0.1
http://en.wikipedia.org/wiki/Localhost

Back to your question: if you intend to use this to replace the other machine on your lan -- i am afraid this may not work.  (to my knowledge).

I am guessing your intention to work on the web application you had on your machine.  Some application (AFAIK), would (by default) have a default restriction (during installation) to allow access from localmachine.  this is why the documentation always refer you to browse to http://localhost/

I believe it would be helpful if you could elaborate further on your problem --- what is the application.

comment from bala -- above, may be what you are looking at here.   also look at the DNS portiong (in that comment).  Hosts file would be a solution if you are in a small network -- but in large organization, where hundreds of machine (or more), this would be a nightmare to maintain -- solution, DNS.

check if the comment from bala works... we would take it from there.

HTH
cheeres.


0
 

Author Comment

by:cybersoftt
ID: 18843001
Hi deresh,
i changed C:\WINDOWS\system32\drivers\etc\hosts with text editor and put bala after localhost like this:

127.0.0.1 localhost bala
 i restarted mysystem also  . But it's not working.


0
 
LVL 6

Expert Comment

by:deresh
ID: 18843155
this ( your last post) will only work from your local machine or the machine where you have installed wamp!

if you want to be able to use address:

http://bala

for other computers on your lan to have access to http://bala you will need to put this line in THEIR  C:\WINDOWS\system32\drivers\etc\hosts :

in your web browser on other machines in your lan, then you must add:


192.168.0.1 bala

if your local lan adress for bala ( computer that has wamp installed) is different from 192.168.0.1 then put that address instead.

this must be don on every computer that wants to access http://bala

you can test if this is done correctly you can write:

ping bala


in command prompt on the machine you have set this up to see if it is set correctly.



but if you have large LAN you should use DNS server, as samri stated, but this is beyond scope of this question.
0
 

Author Comment

by:cybersoftt
ID: 18862346
Hi,
I am checking my localhost system only (this system i installed wamp)
ping bala is working 100% but i try to access http://bala 
i am getting  'Forbidden' error
0
 
LVL 15

Accepted Solution

by:
samri earned 1500 total points
ID: 18863218
check your apache config, and locate the ServerName directive

for example:
ServerName localhost

add a line SeverAlias bala

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question