 |
12-14-2004, 11:49 PM
|
#1 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
"localhost" is not recognized in Apache configuration file
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?
|
|
|
12-15-2004, 01:29 PM
|
#2 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
Can you post up the error message for us to look at? It would help out quite a bit.
Also, what component are you trying to install?
Have you tried putting in the loopback IP address instead (127.0.0.1)?
|
|
|
12-15-2004, 01:53 PM
|
#3 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Error message I get is, "Invalid virtual host name".
I tried putting 127.0.0.1 as well, and one of the followings is the code I'd like to add in my apache configuration file:
Code:
<IfModule mod_webapp.c>
WebAppConnection conn warp 127.0.0.1:8008
WebAppDeploy jsp conn /jsp/
</IfModule>
Code:
<IfModule mod_webapp.c>
WebAppConnection conn warp localhost:8008
WebAppDeploy jsp conn /jsp/
</IfModule>
I'd like to install Tomcat and connect it with Apache. Tomcat has been installed in fact, but the connection is not made yet. Once I figure out how to solve this problem, I should be able to wrap this up.
|
|
|
12-15-2004, 01:59 PM
|
#4 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
What version of Apache are you running?
Also, what do you have entered for ServerName in httpd.conf? This should be uncommented (even if you leave it as 'localhost').
Last edited by insitedev : 12-15-2004 at 02:07 PM.
|
|
|
12-15-2004, 02:12 PM
|
#5 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Apache 1.3.x.
ServerName is uncommented and I just checked this.
Ok, now what? Why do I get the error as I put "localhost"?
|
|
|
12-15-2004, 02:17 PM
|
#6 (permalink)
|
|
Senior Member
Join Date: 08-03-04
Posts: 1,077
Latest Blog: None
|
I had problems with apache myself, then I switched to xitami.
|
|
|
12-15-2004, 02:23 PM
|
#7 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Quote:
|
Originally Posted by DOS
I had problems with apache myself, then I switched to xitami.
|
I appreciate your input, but I really need to solve this problem. Any comment, suggestion on this problem?
|
|
|
12-15-2004, 02:29 PM
|
#8 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
hmm.. ok, down on the bottom of the config file, you should have your virtual hosts. What do you have next to NameVirtualHost
|
|
|
12-15-2004, 02:33 PM
|
#9 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Well, this is what I have:
So, NameVirtualHost is not defined.
Q1. Is this the problem?
Q2. If so, how can I fix it?
Q3. Is the fix going to break anything?
|
|
|
12-15-2004, 02:46 PM
|
#10 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
A1: Possibly
A2: Uncomment it and put in *:80 then restart apache
A3: It shouldn't. At most, it will take down your sites temporarily, but if that happens, just re-add the comment, restart apache and it should be back up.
|
|
|
12-15-2004, 02:50 PM
|
#11 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
If that doesn't work... can you post up your /etc/hosts file so that we can see what is defined in there?
|
|
|
12-15-2004, 04:52 PM
|
#12 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Quote:
|
Originally Posted by insitedev
If that doesn't work... can you post up your /etc/hosts file so that we can see what is defined in there?
|
I tried
Code:
NameVirtualHost *:80
And ran apachectl configtest to test if the configuration works or not. I still got the same error message, "Invalid virtual host name." The following is a copy of my /etc/hosts.
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
216.xxx.xxx.16 ntp1.servepath.com
216.xxx.xxx.17 ntp2.servepath.com
216.xxx.xxx.140 BAS-RedHat72-PSA.YOUR-DOMAIN-HERE.com
(I hided a part of IP address, since I did not want to show every single detail mindlessly.)
|
|
|
12-15-2004, 05:34 PM
|
#13 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
I don't know if this will matter, but try switching the localhost.localdomain and localhost around. All of the machines I have show it that way.
I believe those are aliases and don't matter what order they are in, but, i've seen weirder things happen.
|
|
|
12-15-2004, 05:40 PM
|
#14 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Just one question to make sure. Switching the order won't break anything, will it? Also if I does, I should be able to log into SSH and switch back without any problem, right?
|
|
|
12-15-2004, 05:41 PM
|
#15 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
It shouldn't break anything.
SSH and HTTP are separate services, so yes, you should be able to SSH back in.
|
|
|
12-15-2004, 05:47 PM
|
#16 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
Make sure to change it back if it doesn't work.. that way, we arn't causing more problems.
Next up on the list would be to take a look at your httpd.conf file. You can take out your e-mail address, IP addresses, etc. I can test it over here and see what I come up with.
Last edited by insitedev : 12-15-2004 at 06:01 PM.
|
|
|
12-15-2004, 06:03 PM
|
#17 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
I'm sorry, while I was making changes suggested, I found something. I'd like us to step back.
Initially, I kept thinking that "localhost", the alias is the problem, because I was getting the error message, "Invalid virtual host name". However, as I checked the error message again, I noticed that the error is on line 1306 which is the following:
Code:
WebAppDeploy jsp conn /jsp/
So, I commented out NameVirtualHost like
And I also put /etc/hosts back like
Code:
127.0.0.1 localhost.localdomain localhost
216.xxx.xxx.16 ntp1.servepath.com
216.xxx.xxx.17 ntp2.servepath.com
216.xxx.xxx.140 BAS-RedHat72-PSA.YOUR-DOMAIN-HERE.com
And I just commented out the line 1306 like
Code:
<IfModule mod_webapp.c>
WebAppConnection conn warp localhost:8008
#WebAppDeploy jsp conn /jsp/
</IfModule>
This time, I get the following message, "[warn]NameVirtualHost xxx.xxx.xxx.xxx:443 has no Virtual Hosts Syntax OK." There is no error this time, just a warning. So the problem is:
Code:
WebAppDeploy jsp conn /jsp/
Sorry about all these confusion; this is the problem.
Ok, so now what? What is wrong this line, line 1306?
|
|
|
12-15-2004, 06:19 PM
|
#18 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
Everything that i'm finding on the net regarding this is telling me that you need to explicitly set ServerName. Do you have a regular domain name for it?
I would assume that localhost would work.. but at this point.. try everything..
|
|
|
12-15-2004, 06:25 PM
|
#19 (permalink)
|
|
Inactive
Join Date: 04-15-04
Location: Out there ...
Posts: 197
Latest Blog: None
|
Well, "localhost" itself does not seem to be a problem. Are you sure that I need to set ServerName?
|
|
|
12-15-2004, 06:29 PM
|
#20 (permalink)
|
|
Inactive
Join Date: 12-14-04
Posts: 108
Latest Blog: None
|
From all the articles that I've been reading, i'm sure that it has to be set to something. All of these articles have to do with tomcat, apache, and webapp.
Heres one for an example
http://www.mail-archive.com/jboss-us.../msg11770.html
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:10 AM.
© Copyright 2008 V7 Inc
|
|