Solved

apache access using host name

Posted on 2007-04-01
10
811 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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