A question about configuring Apache Http Server
A question about configuring Apache Http Server
am 10.09.2009 14:05:50 von thomas2004
Hi all,
I installed the Apache Http Web Server on RH-Linux and want to configure it
so that the incoming browsing will be forward to the application deployted
on Jboss. I do followings:
1. Set the ip-address in "/etc/sysconfig/network-scripts/ifcfg-eth0:xx"
2. Create a .conf file which looks as follow:
....
ServerName web-mycompany.com:80
ServerAdmin root@localhost
DocumentRoot /opt/content/web-myweb
debug ALL
WLLogFile /var/log/httpd/wl-proxy-myweb.log
DebugConfigInfo ON
CustomLog /var/log/httpd/web-myweb-test.mycompany-combined_log
combined
ErrorLog /var/log/httpd/web-myweb-test.mycompany-error_log
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
#1 Send everything for context /examples to worker named
worker_portfolio (ajp13)
JkMount /myWebApp* myworker
....
3. Configure the workers.properties as follow:
....
myowrker
# worker template
worker.template.connection_pool_timeout=600
worker.template.socket_timeout=120
worker.template.type=ajp13
worker.socket_keepalive=True
# Set properties for worker_portfolio
worker.myworker.reference=worker.template
worker.myworker.host=test.mycompany.com
worker.myworker.port=8009
....
I think that's all for the configuration. Or maybe I forgot something?
But as I try to call up "http://web-mycompany.com/myWebApp", it failed. I
got error message as follow:
....
The following error was encountered:
* Connection Failed
The system returned:
(111) Connection refused
The remote host or network may be down. Please try the request again.
....
--
View this message in context: http://www.nabble.com/A-question-about-configuring-Apache-Ht tp-Server-tp25382056p25382056.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 10.09.2009 15:05:42 von aw
thomas2004 wrote:
>
> I installed the Apache Http Web Server
what version of Apache ?
on RH-Linux and want to configure it
> so that the incoming browsing will be forward to the application deployted
> on Jboss.
Where is that Jboss server running ?
I do followings:
>
> 1. Set the ip-address in "/etc/sysconfig/network-scripts/ifcfg-eth0:xx"
that has nothing to do with either Apache or Jboss.
>
> 2. Create a .conf file which looks as follow:
> ...
>
> ServerName web-mycompany.com:80
That is probably not correct.
You should have, in one of your Apache configuration files (apache2.conf
or httpd.conf), a line like :
Listen 80
do you ?
There should also be another line somewhere like
NameVirtualHost *:80
(show us the line, exactly as it is in your configuration)
You should probably change the above 2 lines as follows :
ServerName web-mycompany.com
>
> #1 Send everything for context /examples to worker named
> worker_portfolio (ajp13)
>
That comment above is irrelevant to whatever you have below, and
confusing. Better to remove it.
>
> JkMount /myWebApp* myworker
replace this by the following 2 lines :
JkMount /myWebApp/ myworker
JkMount /myWebApp/* myworker
>
>
> ...
>
> 3. Configure the workers.properties as follow:
>
> ...
> myowrker
that should be :
worker.list=myworker
>
> # worker template
> worker.template.connection_pool_timeout=600
> worker.template.socket_timeout=120
> worker.template.type=ajp13
> worker.socket_keepalive=True
>
> # Set properties for worker_portfolio
> worker.myworker.reference=worker.template
> worker.myworker.host=test.mycompany.com
> worker.myworker.port=8009
>
Does the host "test.mycompany.com" exist ?
Is it the host where JBoss is running ?
Does that JBoss "listen" on port 8009 ?
If it does, does it do it with an AJP Connector ?
> ...
>
> I think that's all for the configuration. Or maybe I forgot something?
>
> But as I try to call up "http://web-mycompany.com/myWebApp", it failed. I
> got error message as follow:
where do you get this message ?
>
> ...
> The following error was encountered:
>
> * Connection Failed
>
> The system returned:
>
> (111) Connection refused
>
> The remote host or network may be down. Please try the request again.
> ...
That either means that the host "web-mycompany.com" is not running, or
that it is not listening on port 80.
It looks like you are not even getting as far as connecting to your
Apache webserver.
What happens when you enter this URL :
http://web-mycompany.com
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 10.09.2009 16:16:06 von thomas2004
>what version of Apache ?
It is httpd-2.0.46-46.2.ent
>Where is that Jboss server running ?
On RH-Linux on other machine.
>that has nothing to do with either Apache or Jboss.
You are right. This is configuration of the machine. I have to do this since
the machine will listen to this ip.
>That is probably not correct. You should have, in one of your Apache
configuration files (apache2.conf
>or httpd.conf), a line like :Listen 80
>do you ?
I think this should correct since I just want to listen to the call to this
ip. This ip is mapped to "web-mycompany.com".
There are other xxx.conf files under /etc/httpd/conf.d/. As the http server
starts, it will load all the xxx.conf files from here-
>That comment above is irrelevant to whatever you have below, and confusing.
Better to remove it.
Ok, I did it now.
>replace this by the following 2 lines :
JkMount /myWebApp/ myworker
JkMount /myWebApp/* myworker
I replace them now.
>that should be :
>worker.list=myworker
You are right. I mistyped it.
>Does the host "test.mycompany.com" exist ?
>Is it the host where JBoss is running ?
>Does that JBoss "listen" on port 8009 ?
>If it does, does it do it with an AJP Connector ?
The host exist. This is the Jboss host. I can browser up
"http://test.mycompany.com:8080/myWebApp"
The Jboss "listens" on port 8009. In fact in "workers.properties" there is
another worker which looks as follow:
....
worker.another_worker.reference=worker.template
worker.another_worker.host=another-web-test.com
worker.another_worker.port=8009
....
>where do you get this message ?
On the browser
>That either means that the host "web-mycompany.com" is not running, or
>that it is not listening on port 80.
>It looks like you are not even getting as far as connecting to your Apache
webserver.
Could be. That's the reason I ask this question. :)
Where and how can I check it?
>What happens when you enter this URL :http://web-mycompany.com
The same error.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
--
View this message in context: http://www.nabble.com/A-question-about-configuring-Apache-Ht tp-Server-tp25382056p25384132.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 10.09.2009 16:41:37 von aw
thomas2004 wrote:
....
>
>> That either means that the host "web-mycompany.com" is not running, or
>> that it is not listening on port 80.
>> It looks like you are not even getting as far as connecting to your Apache
> webserver.
>
> Could be. That's the reason I ask this question. :)
>
> Where and how can I check it?
>
Ok, let's start from there.
First, let's see if Apache is running.
When you enter the following command :
netstat -pan | grep '\:80'
it should at least show one line. That line corresponds to the port on
which Apache should be listening.
Toward the end of the line, should be the name of the program, and it's
Process-ID.
You call also try either one of those :
ps -ef | grep httpd
or
ps -ef | grep apache
(I don't remember if under RH Apache appears as httpd or apache2)
Once you make sure that there is an Apache running, then you could try
the following :
enter the command :
telnet web-mycompany.com 80
GET / HTTP/1.0
(the second line above, you have to enter "blind", because there will be
no echo; the third line is just a "return")
Do you get something ?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 09:03:55 von thomas2004
Sorry for the late reply. I am from Germany. As you replied my question I was
out of office. :)
Now return to your answer:
>Ok, let's start from there.
>First, let's see if Apache is running.
>When you enter the following command :
>netstat -pan | grep '\:80'
>it should at least show one line. That line corresponds to the port on
which Apache should be listening. Toward the end of the line, should be the
name of the program, and it's Process-ID.
Yes, I got the line which shows the Apache is listening.
tcp 0 0 172.23.17.8:80 0.0.0.0:*
LISTEN 21625/httpd
>You call also try either one of those :
>ps -ef | grep httpd
>or
>ps -ef | grep apache
I tried both and got a long list such as following:
....
root 21625 1 0 Sep10 ? 00:00:00 /usr/sbin/httpd
apache 21628 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
apache 21629 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
apache 21630 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
....
I think this means the Apache is running.
>Once you make sure that there is an Apache running, then you could try the
following :
>enter the command :
>telnet web-mycompany.com 80
>GET / HTTP/1.0
>(the second line above, you have to enter "blind", because there will be no
echo; the third line is just a "return")
>Do you get something ?
I got followings:
-bash: GET: command not found
But what do you mean "blind" to the second line?
--
View this message in context: http://www.nabble.com/A-question-about-configuring-Apache-Ht tp-Server-tp25382056p25396048.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 09:13:19 von thomas2004
I have to some correction as follow:
>Once you make sure that there is an Apache running, then you could try the
following :
>enter the command :
>telnet web-mycompany.com 80
>GET / HTTP/1.0
>(the second line above, you have to enter "blind", because there will be no
echo; the third line is just a "return")
>Do you get something ?
After I entered "telnet web-mycompany.com 80" I got followings:
Trying 172.23.17.38...
telnet: Unable to connect to remote host: Connection refused
I think here is the problem. What should I do?
--
View this message in context: http://www.nabble.com/A-question-about-configuring-Apache-Ht tp-Server-tp25382056p25396131.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 09:16:14 von aw
thomas2004 wrote:
> Sorry for the late reply. I am from Germany. As you replied my question I was
> out of office. :)
I am in Germany also, so that is a bad excuse. :-)
>
....
> I tried both and got a long list such as following:
> ...
> root 21625 1 0 Sep10 ? 00:00:00 /usr/sbin/httpd
> apache 21628 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
> apache 21629 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
> apache 21630 21625 0 Sep10 ? 00:00:00 /usr/sbin/httpd
> ...
Good. That is one line for each Apache child process, plus one line for
the "main" Apache process (the one running as root).
>
> I think this means the Apache is running.
>
Yes.
>> Once you make sure that there is an Apache running, then you could try the
> following :
>> enter the command :
>> telnet web-mycompany.com 80
>> GET / HTTP/1.0
>
>> (the second line above, you have to enter "blind", because there will be no
> echo; the third line is just a "return")
>> Do you get something ?
>
> I got followings:
> -bash: GET: command not found
That means that the first command (telnet) did not work, and you could
not establish a connection to your webserver on port 80.
You must have received an error message for the telnet command. What
did it say ?
>
> But what do you mean "blind" to the second line?
>
Just the same as "blind" in German, meaning you type but do not see
anything.
If the telnet command had worked, you would be connected to the
webserver via telnet.
What you then type is being sent to the webserver, but does not show on
the screen, because there is no echo.
The fact that the telnet command does not work, but your Apache is
running and listening on port 80,
means that something is getting in the way. There must be a firewall or
something between your workstation and the webserver, which blocks
communications on port 80.
You need to solve that problem first.
Maybe ask your network guys ?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 09:44:51 von Krist van Besien
On Thu, Sep 10, 2009 at 4:41 PM, Andr=E9 Warnier wrote:
>
> Once you make sure that there is an Apache running, then you could try th=
e
> following :
> enter the command :
> telnet web-mycompany.com 80
> GET / HTTP/1.0
>
> (the second line above, you have to enter "blind", because there will be =
no
> echo; the third line is just a "return")
> Do you get something ?
A more comfortable way to test your webserver from your commandline is
with the curl or wget command (every linux distribution has them, i
prefer curl)
So do for example:
curl http://localhost
or
wget http://localhost
on the machine where your apache is running.
From your earlier posts I get that apache runs, but that the webserver
doesn answer connection attempts. That is probably a firewall issue.
Redhat Linux comes with it's own firewall, and it is probably this
what is blocking you. You need to enable port 80. I don't have a RH
machine available right now to test this, so you'll have to look this
up yourself in the documentation.
Krist
--=20
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 10:53:54 von thomas2004
>A more comfortable way to test your webserver from your commandline is with
the curl or wget command (every linux distribution has them, i prefer curl)
>So do for example:
>curl http://localhost
>or
>wget http://localhost
>on the machine where your apache is running.
When I entered "curl http://localhost" I got:
curl: (7) socket error: 111
When I entered "wget http://localhost" I got:
--10:47:07-- http://localhost/
=> `index.html'
Resolving localhost... 127.0.0.1
But strangely on this machine there is already another configuration for
"web-mycompany-test.com" and it works. :) I did the same configuration but
failed. :(
>From your earlier posts I get that apache runs, but that the webserver
doesn answer connection attempts. That is probably a firewall issue.
>Redhat Linux comes with it's own firewall, and it is probably this what is
blocking you. You need to enable port 80. I don't have a RH machine
available right now to test this, so you'll have to look this up yourself in
the documentation.
I shut down the firewall with "service iptables stop". I got the same error.
--
View this message in context: http://www.nabble.com/A-question-about-configuring-Apache-Ht tp-Server-tp25382056p25397353.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: A question about configuring Apache Http Server
am 11.09.2009 23:10:35 von Wolfgang Schaefer
thomas2004 schrieb:
> I have to some correction as follow:
>
>
>> Once you make sure that there is an Apache running, then you could try the
>>
> following :
>
>> enter the command :
>> telnet web-mycompany.com 80
>> GET / HTTP/1.0
>>
>
>
>> (the second line above, you have to enter "blind", because there will be no
>>
> echo; the third line is just a "return")
>
>> Do you get something ?
>>
>
> After I entered "telnet web-mycompany.com 80" I got followings:
>
> Trying 172.23.17.38...
> telnet: Unable to connect to remote host: Connection refused
>
> I think here is the problem. What should I do?
>
> Yes, I got the line which shows the Apache is listening.
> tcp 0 0 172.23.17.8:80 0.0.0.0:*
> LISTEN 21625/httpd
Your output of the netstat command show that your server listens on the ip 172.23.17.8, but you tried to telnet to 172.23.17.38. That would explain why you could not connect to!
Try
telnet 172.23.17.8 80
HEAD / HTTP/1.0 # after this line hit twice the enter key and you should get an output
Another way to test you webserver is as Krist suggested:
> A more comfortable way to test your webserver from your commandline is
> with the curl or wget command (every linux distribution has them, i
> prefer curl)
> So do for example:
> curl http://localhost
> or
> wget http://localhost
Of course here you have to replace localhost with the actual ip or hostname of your server. So in your case this would be:
curl http://172.23.17.8
to test your webserver, because as you can see from your netstat output your server only listens on the ip 172.23.17.8
cheers,
wolfgang
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org