?
Solved

unable to connect to apache server

Posted on 2008-06-13
9
Medium Priority
?
1,003 Views
Last Modified: 2010-04-21
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
Comment
Question by:kranthi_50404
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 21785059
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
 

Author Comment

by:kranthi_50404
ID: 21787761
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
 
LVL 57

Expert Comment

by:giltjr
ID: 21788939
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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 21791529
> Connecting to localhost|127.0.0.1|:443... failed: Connection refused.
sounds like a firewall problem
0
 

Author Comment

by:kranthi_50404
ID: 21795720
I have checked all the rewrite rules and there is no rewrite rule which is redirecting to https.
0
 

Author Comment

by:kranthi_50404
ID: 21797040
could there be any other reason ... this is not related to fire wall or DNS ...rewrite rules  ... i am not sure...
0
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 21798063
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
 

Author Comment

by:kranthi_50404
ID: 21798789
thanks it was the problem with redirect rule.......
0
 

Author Closing Comment

by:kranthi_50404
ID: 31467101
Good response ...great learning
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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