Project

General

Profile

Actions

Support #2384

closed

Server does not process http requests under apache

Added by Vitaly Volochay over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Target version:
Start date:
10/31/2013
Due date:
% Done:

0%

Estimated time:

Description

Hello! I use static resource to process some http-request. It's added by WServer::addResource().

With built-in wt server everything is ok, but when I deploy my web application using apache my WResouce::handleRequest() does not execute when I send requests.

How to make it work?


Files

wt_app_apache.conf (1.08 KB) wt_app_apache.conf Vitaly Volochay, 11/15/2013 09:55 AM
Actions #1

Updated by Koen Deforche over 10 years ago

  • Status changed from New to Feedback

Hey,

The use of addResource() with a FastCGI connector is a bit contrived: you first need to make sure that the request is forwarded from apache to the Wt FCGI application. The addResource() API calls in WServer then take a 'pathInfo' argument really as the URL, so they aren't absolute URLs but URLs relative to the 'deployment path'.

Regards,

koen

Actions #2

Updated by Vitaly Volochay over 10 years ago

Thanks, Koen! Than the answer is how to forward request from apache to my Wt FCGI application?

I have application with static resource added to path '/service':

server.addResource(new MyResource, "/service");

Assume I have simple apache (which is not true actually, in real one I use proxy pass + rewrite engine) config:

<IfModule mod_fcgid.c>

Listen 10101

NameVirtualHost *:10101

<VirtualHost *:10101>

IdleTimeout 3600

ProcessLifeTime 7200

IPCConnectTimeout 300

IPCCommTimeout 7200

BusyTimeout 300

DocumentRoot /var/www/myapp/docroot/

AddHandler fcgid-script wt

DirectoryIndex my_app.wt



Order Deny,Allow

Allow from all

Options +ExecCGI -Indexes

FcgidInitialEnv WT_APP_ROOT /var/www/myapp/approot/

SetEnv MYAPP_CONF_PARAM my_app.xml

When I am trying:

curl -X POST http://localhost:10101/my_app.wt/service

Server returns js code of server (seems to me like this), same as i send request to http://localhost:10101/my_app.wt. Obviously /server resource does not proccess it.

So how to make correct forwarding requests from apache to wt app?

Actions #3

Updated by Koen Deforche over 10 years ago

  • Status changed from Feedback to InProgress
  • Assignee set to Koen Deforche

Hey,

Your setup looks indeed correct. We will see if we can reproduce this issue. Is the configuration above really the actual configuration since you say that you actually use a proxy_pass + rewrite engine?

Regards,

koen

Actions #4

Updated by Vitaly Volochay over 10 years ago

Thanks for you help!

I attached my real configuration. I tried both configs and requests didn't reach wt application.

Actions #5

Updated by Koen Deforche over 10 years ago

  • Status changed from InProgress to Feedback

Hey,

Sorry that it took some time, but I've now tested this again and it does work as expected for me. One thing to note is that the order of the entry paths is taken into account. You should thus deploy the resource before you deploy the actual application:

   server.addResource(resource, "/service);
   server.addEntryPoint(Application, ..., "");

I tested this with the blog example, so you may want to see if that does work for you and if so what is the difference with your project.

Regards,

koen

Actions #6

Updated by Vitaly Volochay over 10 years ago

Thx, Koen! Issue with order solve the problem.

Actions #7

Updated by Koen Deforche over 10 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF