Asking Advice "localhost" Is Not Recognized In Apache Configuration File

Status
Not open for further replies.
O

ooen

I am configuring Apache to install some component and I need to use the alias (?) "localhost", but apparently it's not recognized. Because of that, I keep getting an error message, as I put the word in Apache configuration file. What am I missing? What do I need to do so that the server/Apache recognizes the word?
 
C

criserb

I've tried some time ago to make the same thing, try to replace the "localhost" with your IP. In my case was a good idea.
 

alexandru

Yellow Belt
localhost represents the hostname traditionally used for referring to your own machine, and assigned to IP address 127.0.0.1
This represents a testing mechanism, so that even machines without Internet connectivity can test network related programs.
Normally any OS should implement it... even Windows.
If this is not your case you can set it up like this:

for Windows 98 and below:
edit c:\windows\hosts <- that's right! no extension!! no hosts.txt or hosts.doc, just hosts
OR
for Windows XP w2k or above:
edit c:\windows\system32\drivers\etc\hosts

and insert in that file if exists(, or create it if it doesen't):
127.0.0.1 localhost

That's all, the loopback address should behave as expected now.
 

alexandru

Yellow Belt
Hehe, my kind of OS then... :)

All you need to do is edit this file:
/etc/hosts

The rules are just like those for Windows:
edit it and either find a line that begins with
127.0.0.1 somename
and add localhost to it, e.g.

127.0.0.1 somename localhost

You are allowed to have as many alliases as you wish for an IP
If you find no such line, just add it yourself.

It's really weird though, any Linux comes by default with localhost added to the hosts file....
Maybe the problem is somewhere else... ?
If you give this command:
ping localhost
what do you get?
 
O

ooen

Well, here's the latest. I kept thinking that "localhost" is not recognized, but I was completely wrong (so I believe). After I checked the error message, I found that

I have the following code:
Code:
<IfModule mod_webapp.c>
	WebAppConnection conn warp localhost:8008
	WebAppDeploy jsp conn /jsp/
</IfModule>
I keep getting the following error message, "Invalid virtual host name" and the error comes from the third line in the given code which is the following:
Code:
WebAppDeploy jsp conn /jsp/
If I comment out this particular line, I do not get any error message, so I have to assume that there is something wrong here.

What is wrong with this particular line? Why do I get this error message "Invalid virtual host name"?
 

alexandru

Yellow Belt
ooen said:
<IfModule mod_webapp.c>
WebAppConnection conn warp localhost:8008
WebAppDeploy jsp conn /jsp/
</IfModule>
That is for configuring Tomcat under Apache. I never configured onw though so I'm not familiar with the error you receive, but if you don't need Tomcat you can just comment out the whole section and spare yourself a headache.
 
Status
Not open for further replies.
Top