• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sending an HTTP request from behind Apache

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've developed a web application with mobile clients. The web application is deployed on Tomcat 6 which is hooked up to Apache 2.2 with mod_proxy.

During execution, the web application sends an HTTP request to an sms messaging service (BulkSms), and an sms is sent to my cell phone to invoke the mobile client application.

The system works well when Tomcat is running by itself. However, when Apache is also running, I get an error message and my sms request fails to arrive at BulkSms.

A lot of this is new territory for me, but I think I may have a configuration issue which is preventing my request from being dispatched.

I've tried to research this on the web, but I haven't found anything useful.

I am now completely stuck, and I would be very grateful for any ideas.


Thanks

Jenny
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think we'll need more information than that. If a J2EE webapp is using HTTP to send SMS to an external gateway webapp, there's no way Apache fronting the J2EE app should make any difference at all. Most likely you have some sort of firewall changes that were made when Apache was brought in, but it would help if you could provide us with the exact text of the error message.
 
Jenny Goodwin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim!

WOW! I hadn't expected such a fast reply!

First of all, just to clarify, I'm not using HTTP to send SMS. All I'm sending is a standard HTTP post request to the BulkSms website, and they send an sms to my cell phone to trigger the mobile client application.

When I first ran the system with Apache running, I got a 401 (authorisation/authentication) error:


As the error specified the BulkSms url, I initially thought that this was where the error was occurring, but when I inquired about this, BulkSms replied that they had no record of a 401 error having occurred.

After further trials, I removed the password file from Apache and ran the system again. This time I got a different error:


The error message changed as a result of changing Apache, and this led me to think that I had a configuration problem. This is the first time I've configured a server, so I'd better show you what I did.

Tomcat's server.xml file already had this line:


In Apache's httpd.conf file, I made sure that the proxy modules were un-commented:


I then added the following lines to configure the proxy:



Finally, I configured the Windows firewall to allow tcp and udp exceptions for httpd.exe on ports 80 and 443, all scoped for any computer.

As I said before, most of this is new territory for me. I'm still struggling with some of the basic concepts, so any advice you can offer will be very much appreciated.


Tim, thanks for taking an interest

Jenny
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Timing is everything. I usually make my rounds in the morning local time on business days. I may check in at other times, but that depends on what other distractions I have.

I should clarify that "HTTP SMS request" is just my shorthand for "using an HTTP service to send SMS". What you're doing is basically a REST request to the SMS gateway.

An HTTP 401 is a security challenge. Normally it's what you get when a server has implemented BASIC authentication, and it's what causes your browser to pop up a login dialog box.

How you then ended up getting a "File not found exception" on a URL puzzles me, though. Especially since this is supposed to be an outbound URL request.

Your Apache-to-Tomcat proxying appears OK to me.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic