Solved

unable to connect to apache server

Posted on 2008-06-13
9
985 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
  • 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
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 500 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 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