• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1009
  • Last Modified:

unable to connect to apache server

I am using apache 2.2 and tomcat 6.0 and i have configured the apache port to be 8000 and tomcat port to 8001. when i am using the wget command i am not able to get the 200 result with port 8000 and i am getting the 200 result with port 8001.please find the below sample from my server .

alphacemsharedapp01-us.alpha.online.ea.com{cdc-ops}67: wget http://localhost:8001/sharedservices/js/appspin-test.js
--21:57:25--  http://localhost:8001/sharedservices/js/appspin-test.js
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8001... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4690 (4.6K) [text/javascript]
Saving to: `appspin-test.js'

100%[====================================================================================================================>] 4,690       --.-K/s   in 0s

21:57:25 (280 MB/s) - `appspin-test.js' saved [4690/4690]

alphacemsharedapp01-us.alpha.online.ea.com{cdc-ops}68: wget http://localhost:8000/sharedservices/js/appspin-test.js
--22:11:27--  http://localhost:8000/sharedservices/js/appspin-test.js
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost/sharedservices/js/appspin-test.js [following]
--22:11:27--  https://localhost/sharedservices/js/appspin-test.js
Connecting to localhost|127.0.0.1|:443... failed: Connection refused.
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:443... failed: Connection refused.
alphacemsharedapp01-us.alpha.online.ea.com{cdc-ops}69:
0
kranthi_50404
Asked:
kranthi_50404
  • 5
  • 3
1 Solution
 
giltjrCommented:
Lets break down the Apache stuff.

You issue the wget to port 8000 and you DO get a response.  But the response is a 302.  This means, that Apache sucesffully received the request and processed it, but is sending you to a different location.  

It is sending you to httpS://localhost/shareservice/js/appspin-test.js, notice the httpS.  This means something is saying use SSL instead  of non-SSL.  So wget then tries to connect to Apache on port 443, which gets rejected.  This means that although Apache re-directed you to port 443, it is not listening on port 443.

You either need to configure Apache to listen on port 443 and set it (Apache) to support SSL, or you need to figure out why it is redirecting a non-SSL request to SSL and stop.
0
 
kranthi_50404Author Commented:
thanks for your analysis..

when i was thinking what would be the reason why it was trying to connect to port 443 ....i have a question whether this would be related to domain name...FYI the above this does not have the DNS configured....and i have'nt made any configuration changes in my apache for SSL...and i want it to listen to port 8000 and in http.conf file listen port is 8000.
0
 
giltjrCommented:
Well not really, but it could be.    In the pure sense the host/domain name only determines what IP address to connect to, not the port.  DNS only looks up the name to determine the address, not the port.  What determines the port is typically the "service" you are trying to access.  Telnet is port 23, SMTP is port 25, http is 80 and https is port 443.  However you can change these to use any port you want.

However, if you have re-write/re-direct rules in Apache you can change what URL a request is sent to and as part of this change you can change the port.  So if you get a request to your Apache server on port 8000, you could have a re-write that changes it to https.  The HTTP code 302, means that something is changing (re-directing/re-writing) where it wants you to go and it wants you to go to https instead of http.


0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
ahoffmannCommented:
> Connecting to localhost|127.0.0.1|:443... failed: Connection refused.
sounds like a firewall problem
0
 
kranthi_50404Author Commented:
I have checked all the rewrite rules and there is no rewrite rule which is redirecting to https.
0
 
kranthi_50404Author Commented:
could there be any other reason ... this is not related to fire wall or DNS ...rewrite rules  ... i am not sure...
0
 
giltjrCommented:
The 302 returned on the wget indicates that something is doing a http redirect.

You could run a packet capture from the computer that Apache is running on.  If the you see the GET come in and a HTTP 302 response go out, that means something on that computer is doing it.  Since it works going directly to tomcat, that leaves Apache.
0
 
kranthi_50404Author Commented:
thanks it was the problem with redirect rule.......
0
 
kranthi_50404Author Commented:
Good response ...great learning
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now