[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

unable to connect to apache server

Posted on 2008-06-13
9
Medium Priority
?
1,007 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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 this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month12 days, 12 hours left to enroll

650 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