Unable to get to my site on new installation.
Added by Zalu Hobgobicus almost 10 years ago
I have a Wt httpd app which was working before I recently installed new versions of Wt (3.3.4rc1 from 3.3.0rc1) and Boost (libboost1.55-all-dev from libboost1.46-all-dev) on a new computer (Ubuntu 14.04, was working on Ubuntu 12.04). I've been working on adding some Boost::asio code, but I just noticed that now the app still builds and runs, but I don't seem to be able to browse to my site any more. I haven't changed the Wt code, or the command-line I use to run the Wt server program, but I realize the wt_config.xml file is now the default file from the fresh install of Wt 3.3.4rc1.
I will shortly go back to the previous dev computer and try running the new code there, and compare the wt_config file from that computer to the current one.
My code:
@int main(int argc, char **argv)
{
// Set up shared resources:
SessionCount = 0;
// Run ASIO communications to/from GameServer in another thread:
boost::thread ASIOThread(RunGameServerComms);
// createApplication specifies the function that will instantiate
// new application objects. That function is executed when a new user surfs
// to the Wt application, and after the library has negotiated browser
// support. The function should return a newly instantiated application
// object.
// Authentication routine replaces call to WRun:
try
{
Wt::WServer server(argv[0]);
server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
server.addEntryPoint(Wt::Application, createApplication);
Session::configureAuth();
if (server.start())
{
Wt::WServer::waitForShutdown();
...@
and my command-line to run the program is like:
./ws --docroot==.. . --http-address 0.0.0.0 --http-port 9090
It used to work fine to then browse to 0.0.0.0:9090, but now I get "Firefox can't establish a connection to the server at 0.0.0.0:9090" or on Opera "Invalid address" (which I assume means 404 error - nothing responding to that request).
Replies (5)
RE: Unable to get to my site on new installation. - Added by Zalu Hobgobicus almost 10 years ago
Ok, so I went back to my old dev machine, but I had updated it too to Ubuntu 14.04, and this seemed to require re-installing boost, which I did using the Ubuntu Software Center, which gave me version . This affected my build, and gave me linker errors to Boost libraries when building my Wt project, so I tried rebuilding Wt 3.3.0rc1, which had worked with my Wt program before. I got Wt to build, and then had a new error linking my project, where "the symbol __cxa_free_exception@@CXXABI_1.3" was now an undefined reference... which I found is apparently suffered by g programmers upgrading from Ubuntu 12.04 to 14.04, and solved by adding a linker parameter of -lstdc. Now my Wt program builds and runs on my old dev system... but it still does not actually seem to serve up my site so that browsers can get to it.
I am thinking maybe I am running a version of Boost that does not play well with Wt?
What's the recommended version of Boost to use Wt 3.3.4rc1 these days (I will start Googling for this...)?
RE: Unable to get to my site on new installation. - Added by Mark Petryk almost 10 years ago
Hi Zalu,
I'm running Wt-3.3.4-rc1 with Boost on Ubuntu 14.04. The boost libraries were the typical repo libboost-all-dev which looks like it's around 54 or 55 depending on the module. If I were you I'd scarf through all your Wt libraries and make sure they're fully removed, and then fully recompile your project. I'd go through and make sure you don't have any stray .o files left over and everything and all that...
~mark
RE: Unable to get to my site on new installation. - Added by Zalu Hobgobicus almost 10 years ago
Thanks Mark! That looks like great steps for carefully rebuilding Wt. I've got libboost-all-dev 54 on one box, and libboost-all-dev 55 on the other, but I think that might not be my issue.
I've been trying another approach, which is reverting to earlier versions of my project and seeing what runs. What I've found is that the page comes up fine on versions before I started adding Boost ASIO and its thread. However, even when I comment out all the lines that actually use ASIO or threads, the program still fails to actually start the Wt Server. It gets initialized but not started, even when I've commented down the new version to look just like the old version. This sounds like some old questions I saw from a few years ago where people found that Boost ASIO #include headers would mess up Wt for someone. IIRC, Emweb couldn't repro the problem and the suspect was mixing versions of Boost when building Wt versus the project, though in this case I am pretty sure they were both built with libboost 55. Hmm. It's probably time for me to sleep on it.
RE: Unable to get to my site on new installation. - Added by Zalu Hobgobicus almost 10 years ago
I think I am running into the same problem reported here: http://redmine.webtoolkit.eu/boards/2/topics/8847?r=10482
That is, it may be about the C standard used to build my project vs. Wt, when trying to use Boost::asio.
I've been comparing to past versions of my project which run, and backing out code though I thought I backed out everything and it's still getting stuck inside WServer::Run().
I can build in c++11 but it still gets stuck.
Aha! If I build in c++03, it works again!
Hmm, but sadly I can't use std::unordered_map in 03... though I can in 0x and 11... I guess I should try to rebuild Wt in c++11...
RE: Unable to get to my site on new installation. - Added by Zalu Hobgobicus almost 10 years ago
I found that on one machine (Ubuntu 14.04, Boost 1.55, Wt 3.3.4-rc1), it would work with c++03.
However, on another machine (Ubuntu 14.04, Boost 1.54, Wt 3.3.4-rc1), it would NOT work with c+03. This combo would say it was running, but then the web site would never actually come up. Wt was not reporting that it detected any connect attempts. However, re-building Wt using c11 on this machine and then building my project also with c+11 DOES work (and gets me std::unordered_map).
Note to anyone else who has this issue but doesn't immediately see how to build Wt using c++11, my steps:
cd wt-x.xx
mkdir build
cd build
cmake ../
Edit the file CmakeCache.txt changing the line:
WT_CPP_11_MODE:STRING=
to
WT_CPP_11_MODE:STRING=-std=c++11
make
sudo make install
sudo ldconfig