Solved

unable to connect to apache server

Posted on 2008-06-13
9
964 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
 
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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 …

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now