apache access using host name

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




cybersofttAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dereshCommented:
you can do this already. by default apache listens ond localhost. But you can do this only on machine where wamp is installed.
0
and235100Commented:
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
cybersofttAuthor Commented:
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
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

and235100Commented:
What about - as I said:

http://<ip address>
0
dereshCommented:
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
samriCommented:
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
cybersofttAuthor Commented:
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
dereshCommented:
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
cybersofttAuthor Commented:
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
samriCommented:
check your apache config, and locate the ServerName directive

for example:
ServerName localhost

add a line SeverAlias bala

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.