wt/nginx/fastcgi displaying empty page
Added by Matt Kingston over 12 years ago
Hi there,
I've tried compiling the wt hello example in a variety of ways but have had no luck serving it via fastcgi. However, I can use the hello example built with the provided CMakeLists.txt. I'm slowly trying to dissect this cmake file, but it's a little slow going, it'd be great if someone could give me a hand! I present detail of my compilation attempts, the web addresses associated with these attempts, and further information relating to my build, versions etc. Notice there is slightly different behaviour between my cmake and g compilation attempts, notably my cmake attempt actually loads and serves up some source, but doesn't display as I'd hoped.
The working hello example, compiled with the provided cmake file is here:
http://198.74.50.166/defcmake/
(Isn't it glorious! Now I need to harness this power..)
I've tried simply compiling as follows:
g hello.C -lwt -lwtfcgi -lfcgi -lboost_signals
This attempt is hosted here: http://198.74.50.166/wt/
I've tried using CMake as described here: http://redmine.webtoolkit.eu/wiki/1/Using_CMake?version=2
I had thought possibly as cmake seems to do some replacement of text in header files this might do something I had been missing when compiling with g. As far as I can tell, this is not the case. I attempted to figure out what bash commands make was executing to compile my source, but couldn't figure out how.
This attempt is hosted here: http://198.74.50.166/wtcmake/
My CMakeLists.txt files are as follows:
in the root directory:
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT (WT_EXAMPLE)
SET (WT_CONNECTOR "wtfcgi")
ADD_SUBDIRECTORY(source)
in directory /source/:
SET (WT_PROJECT_SOURCE
hello.C
)
SET (WT_PROJECT_TARGET wt_project.wt)
ADD_EXECUTABLE(${WT_PROJECT_TARGET} ${WT_PROJECT_SOURCE})
TARGET_LINK_LIBRARIES(${WT_PROJECT_TARGET} ${WT_CONNECTOR} wt boost_signals fcgi)
INCLUDE_DIRECTORIES(/usr/local/include/Wt)
Further info:
I'm using Ubuntu Server 12.04.
I installed nginx, boost libs (v1.46, the default for this version of Ubuntu), spawn-fcgi etc. from standard repositories
I installed Wt (3.2.3) from source following these instructions: http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html
I set the connector to FCGI when installing.
I am able to host a generic FCGI example app (provided with the fcgi source), see here: http://198.74.50.166/fcgi/
I cannot host the wt hello example with the development server. I suspect this is because I used the fcgi connector during installation.
I compile with the development server using the following command: g hello.C -lwt -lwthttp -lboost_signals. I receive the following output:
root@li547-166:~/wt-3.2.2-p1/examples/hello# ./a.out ---http-port 8080 ---docroot . ---http-address 0.0.0.0 ---gdb
[2012-Nov-15 09:30:58.575633] 19271 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = './a.out')"
[2012-Nov-15 09:30:58.578024] 19271 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2012-Nov-15 09:30:58.578745] 19271 - [info] "wthttp: started server: http://0.0.0.0:8080"
[2012-Nov-15 09:31:02.661438] 19271 - [info] "Wt: session created (#sessions = 1)"
[2012-Nov-15 09:31:02.661982] 19271 [/ fpjZZYiDlloSz4Ho] [info] "WEnvironment: UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11"
101.98.159.28 - - [2012-Nov-15 09:31:02.664061] "GET / HTTP/1.1" 200 1844
[2012-Nov-15 09:31:02.664186] 19271 - [info] "WebRequest: took 2.984ms"
Segmentation fault (core dumped)
root@li547-166:~/wt-3.2.2-p1/examples/hello#
If you need any more info, let me know.
Thanks very much in advance!