Solved

apache access using host name

Posted on 2007-04-01
10
803 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

807 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