Solved

apache access using host name

Posted on 2007-04-01
10
781 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
  • 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
 
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now