OpenShift Error The requested URL / was not found on this server - python-2.7

I've been trying to deploy a flask app on openshift. I tested the website and it runs just fine on the development server (both by typing python app.py and manage.py runserver), I uploaded the project to github and created the app using this command from terminal:
rhc create-app marcsantiago python-2.7 --from-code=https://github.com/marcsantiago/personalwebsite.git
The app seems to be created without a problem. The issue occurs when I try and visit the created url:
http://marcsantiago-mywebappsflask.rhcloud.com
I receive a not found error The requested URL / was not found on this server.
I don't understand what i did wrong or how to fix it so that the website it live. It is a simple website, which uses no databases.
Could someone please help me resolve this issue?
this the postgresql.log information, though i'm not sure how relevant it is since i don't use a database, python.log is below
2015-07-22 02:05:44 GMT LOG: could not bind socket for statistics collector: Permission denied
2015-07-22 02:05:44 GMT LOG: trying another address for the statistics collector
2015-07-22 02:05:44 GMT LOG: could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:05:44 GMT LOG: disabling statistics collector for lack of working socket
2015-07-22 02:05:44 GMT WARNING: autovacuum not started because of misconfiguration
2015-07-22 02:05:44 GMT HINT: Enable the "track_counts" option.
2015-07-22 02:05:44 GMT LOG: database system was shut down at 2013-05-21 05:07:11 GMT
2015-07-22 02:05:44 GMT LOG: database system is ready to accept connections
2015-07-22 02:05:48 GMT LOG: received smart shutdown request
2015-07-22 02:05:48 GMT LOG: shutting down
2015-07-22 02:05:48 GMT LOG: database system is shut down
2015-07-22 02:06:04 GMT LOG: could not bind socket for statistics collector: Permission denied
2015-07-22 02:06:04 GMT LOG: trying another address for the statistics collector
2015-07-22 02:06:04 GMT LOG: could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:06:04 GMT LOG: disabling statistics collector for lack of working socket
2015-07-22 02:06:04 GMT WARNING: autovacuum not started because of misconfiguration
2015-07-22 02:06:04 GMT HINT: Enable the "track_counts" option.
2015-07-22 02:06:04 GMT LOG: database system was shut down at 2015-07-22 02:05:48 GMT
2015-07-22 02:06:04 GMT LOG: database system is ready to accept connections
python.log
[Tue Jul 21 22:06:07 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c294
[Tue Jul 21 22:06:07 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Jul 21 22:06:07 2015] [notice] Digest: done
[Tue Jul 21 22:06:07 2015] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.4 Python/2.7.8 configured -- resuming normal operations
(98)Address already in use: make_sock: could not bind to address 127.12.133.129:8080
no listening sockets available, shutting down
Unable to open logs
[Tue Jul 21 22:07:01 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667
67.84.182.205 - - [21/Jul/2015:22:07:01 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3"
[Tue Jul 21 22:08:49 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1
124.32.215.10 - - [21/Jul/2015:22:08:49 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:08:50 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://marcsantiago-mywebappsflask.rhcloud.com/
124.32.215.10 - - [21/Jul/2015:22:08:50 -0400] "GET /favicon.ico HTTP/1.1" 404 315 "http://marcsantiago-mywebappsflask.rhcloud.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi
sorry for how messy it looks, couldn't think of a better way to share the logs other than pasting them in.

Have you tried reading through the section of the Developer Portal that is about using Flask on OpenShift Online?
https://developers.openshift.com/en/python-flask.html

The domain is not pointing to any server.
This is most likely an issue in your configuration on Openshift, an error in their server configuration or a mistyping of the URL on your side.
Contact Openshift or check their logs.
Edit:
Looking at the new logs, it becomes clear that the server can't find your WSGI app. You mention that it is called app.py, but the server may be looking for something else. The more common file name would be application.py. Check your configuration at OpenShift and adjust the WSGI application file name accordingly.

Related

Deploying django app to digital ocean unsuccessful (502 Bad Gateway)

Good day guys, I am in a bit of a mess here with deploying a Django app to the digital ocean using Gunicorn and Ngnix. I am following the steps in a video tutorial I bought on udemy, where we are following a link https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#disable-root-login. while following the tutorial, everything worked to the point before I set up gunicorn, which means I was able to see the website through the IP address. but, only that the static files were not handled by Nginx and I was running the server using python manage.py runserver 0.0.0.0:8000 when I was at this point https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#run-server. when I followed the step and configured gunicorn and Nginx, I was getting 502 Bad Gateway when I visited using the IP address.
I was wondering why I was getting this issue, and I noticed that when I checked the status of gunicorn using sudo systemctl status gunicorn.socket I was getting:
gunicorn.socket - gunicorn socket
Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled; vendor preset: enabled)
Active: failed (Result: service-start-limit-hit) since Fri 2020-02-28 03:03:11 UTC; 7s ago
Listen: /run/gunicorn.sock (Stream)
here is a link to the project I was trying to add to the server if needed https://github.com/opeodedeyi/medxFinal
when i run sudo nginx -t i get
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
just incase this is how my gunicorn service file is set up
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=djangoadmin
Group=www-data
WorkingDirectory=/home/djangoadmin/pyapps/medxFinal
ExecStart=/home/djangoadmin/pyapps/medxFinal/venv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
medx.wsgi:application
[Install]
WantedBy=multi-user.target
and just the explain how my folder is structured, inside the medxFinal is where the venv and medx folders are, inside that medx folder is where the manage.py is and other folders including another medx folder are found, inside the last medx is where the settings.py, wsgi, and first URL is.
running sudo tail -F /var/log/nginx/error.log i see this
2020/02/28 07:33:51 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //vendor/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://vendor/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 07:33:52 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //wp-content/plugins/cloudflare/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://wp-content/plugins/cloudflare/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 07:33:52 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //wp-content/plugins/dzs-videogallery/class_parts/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://wp-content/plugins/dzs-videogallery/class_parts/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 07:33:52 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //wp-content/plugins/jekyll-exporter/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://wp-content/plugins/jekyll-exporter/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 07:33:52 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //wp-content/plugins/mm-plugin/inc/vendors/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://wp-content/plugins/mm-plugin/inc/vendors/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 07:33:52 [error] 15252#15252: *12 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 95.217.130.88, server: 64.225.59.162, request: "POST //www/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock://www/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php", host: "64.225.59.162", referrer: "https://www.google.com/"
2020/02/28 08:58:29 [error] 15252#15252: *45 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 46.119.158.129, server: 64.225.59.162, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "64.225.59.162:80"
2020/02/28 09:28:40 [error] 15252#15252: *47 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 189.51.114.40, server: 64.225.59.162, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "64.225.59.162:80"
2020/02/28 10:01:41 [error] 15252#15252: *51 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 105.112.56.238, server: 64.225.59.162, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "64.225.59.162"
2020/02/28 10:07:46 [error] 15252#15252: *54 connect() to unix:/run/gunicorn.sock failed (111: Connection refused) while connecting to upstream, client: 78.165.205.193, server: 64.225.59.162, request: "GET / HTTP/1.1", upstream: "http://unix:/run/gunicorn.sock:/", host: "64.225.59.162:80"
running sudo journalctl -u nginx
-- Logs begin at Thu 2020-02-27 03:32:45 UTC, end at Fri 2020-02-28 11:18:20 UTC. --
Feb 27 10:41:35 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 10:41:35 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 10:41:35 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:26:42 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:26:42 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:26:42 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:26:42 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:26:42 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:29:33 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:29:33 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:29:33 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:29:33 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:29:33 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:31:13 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:31:13 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:31:13 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:31:13 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:31:13 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:50:26 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:50:26 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:50:26 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:50:26 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:50:26 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:51:21 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:51:21 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:51:21 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:51:21 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:51:21 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 13:57:12 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 13:57:12 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 13:57:12 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 13:57:12 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 13:57:12 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 14:54:08 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 14:54:09 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 14:54:09 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 14:54:09 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 14:54:09 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 27 14:56:15 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 27 14:56:15 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 27 14:56:15 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 14:56:15 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 14:56:15 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Feb 28 03:29:52 ubuntu1 systemd[1]: Stopping A high performance web server and a reverse proxy server...
Feb 28 03:29:52 ubuntu1 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 28 03:29:52 ubuntu1 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 28 03:29:52 ubuntu1 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 28 03:29:52 ubuntu1 systemd[1]: Started A high performance web server and a reverse proxy server.
Did you check your gunicorn.service and gunicorn.socket file?
Did you add the correct user name for user in gunicorn.service file?
[Service]
User=<yourusername>
Group=www-data
if so try these commands
curl --unix-socket /run/gunicorn.sock localhost
if the above command prints out the html page in the terminal, then you are good to go or else change the gunicorn.service file and try again
sudo systemctl daemon-reload
sudo systemctl restart gunicorn
I think your service file should be like this, based on your github repo
WorkingDirectory=/home/djangoadmin/pyapps/medxFinal/medx
Try sudo tail -F /var/log/nginx/error.log
and refresh to see the updates in the log. From the result it is easy to find a solution

How to display my Wt application in my local apache server?

I am very new to Wt and cgi stuff. What I am trying to do is write a web application in C++. This is possible thanks to the Wt library:
https://www.webtoolkit.eu/wt
Apparently there are two modes: http and fastcgi. The former is straightforward to use: I compile my code and run the bin. This starts some kind of web server (my vocabulary is probably not exact, as I am a big noob in this domain) and outputs the server's address and port. Typing all that in my favorite browser results in displaying the web page that I coded in C++.
I have a big problem with the latter and this is very annoying because this is the only way to deploy the software on a hosted remote server.
To deploy a test web server, I took the hello example found in the Wt library and linked it against wtfcgi by defining the cmake variable EXAMPLES_CONNECTOR=wtfcgi.
After that, I installed apache2 and set it up. I did the following:
I installed the following Ubuntu packages:
libapache2-mod-fastcgi
apache2
apache2-bin
apache2-data
apache2-utils
Then,
enable mod_fastcgi for Apache with a2enmod
modify the configuration file fastcgi.conf like this:
<IfModule mod_fastcgi.c>;
AddHandler fastcgi-script .wt
FastCgiIpcDir /var/lib/apache2/fastcgi
FastCgiConfig -idle-timeout 100 -maxClassProcesses 1 -initial-env WT_APP_ROOT=/tmp
FastCgiServer /var/www/wt/hello.wt
</IfModule>
create a new site configuration file for wt applications, /etc/apache2/sites-available/wt.conf:
<Directory /var/www/wt/>
Allow from all
Options +ExecCGI
</Directory>
copy my Wt example code into the folder /var/www/wt/hello.wt
enable the site and reload apache
a2ensite wt
service apache2 reload
Then, after that, the /var/log/apache2/error.log gave me
[Fri Jun 16 22:52:30.176846 2017] [core:notice] [pid 1676:tid 139808785006080] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jun 16 22:52:30.177041 2017] [:warn] [pid 1678:tid 139808785006080] FastCGI: server "/var/www/wt/hello.wt" started (pid 1682)
[2017-Jun-16 22:52:30.328742] 1682 - [info] "WServer/wtfcgi: initializing relay server"
[2017-Jun-16 22:52:30.332011] 1682 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/wt/hello.wt')"
[2017-Jun-16 22:52:30.334308] 1682 - [info] "wtfcgi: spawned session process: pid = 1737"
[2017-Jun-16 22:52:30.334383] 1682 - [error] "wtfcgi: fatal: cannot create run directory '/var/run/wt'"
[Fri Jun 16 22:52:30.337635 2017] [:warn] [pid 1678:tid 139808785006080] FastCGI: server "/var/www/wt/hello.wt" (pid 1682) terminated by calling exit with status '1'
[2017-Jun-16 22:52:30.375392] 1737 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/wt/hello.wt')"
[2017-Jun-16 22:52:30.375519] 1737 - [info] "WServer/wtfcgi: initializing shared wtfcgi session process"
[2017-Jun-16 22:52:30.375708] 1737 - [error] "wtfcgi: fatal: bind(): No such file or directory"
After that, I followed the advice given in this web page:
http://redmine.webtoolkit.eu/projects/wt/wiki/Fastcgi_on_apache
For instance, I created the /var/run/wt myself and changed its owner to www-data. Then I got this log:
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Jun 16 23:15:53.355484 2017] [:notice] [pid 1994:tid 139719627398656] FastCGI: process manager initialized (pid 1994)
[Fri Jun 16 23:15:53.355544 2017] [mpm_event:notice] [pid 1656:tid 139719627398656] AH00489: Apache/2.4.18 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 configured -- resuming normal operations
[Fri Jun 16 23:15:53.355554 2017] [core:notice] [pid 1656:tid 139719627398656] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jun 16 23:15:53.355676 2017] [:warn] [pid 1994:tid 139719627398656] FastCGI: server "/var/www/wt/hello.wt" started (pid 1995)
[2017-Jun-16 23:15:53.365485] 1995 - [info] "WServer/wtfcgi: initializing relay server"
[2017-Jun-16 23:15:53.365675] 1995 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/wt/hello.wt')"
[2017-Jun-16 23:15:53.365878] 1995 - [info] "wtfcgi: spawned session process: pid = 2052"
[2017-Jun-16 23:15:53.365942] 1995 - [info] "wtfcgi: reading FastCGI stream from stdin"
[2017-Jun-16 23:15:53.373121] 2052 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/wt/hello.wt')"
[2017-Jun-16 23:15:53.373243] 2052 - [info] "WServer/wtfcgi: initializing shared wtfcgi session process"
which then looks fine. However, when I now display the address 127.0.1.1 on my firefox browser, I still see the default apache2 webpage. Why don't I see the hello example? How do I fix this? Do I have to write a special html page that calls the hello.wt? How does that work?
It seems like something is started but doesn't keep running. Where can I find logs of that?
Thanks in advance!
I managed to make it work by doing the following:
make sure the folder /var/www/html exists and copy my wt application there
modify the configuration file fastcgi.conf like this:
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .wt
FastCgiIpcDir /var/lib/apache2/fastcgi
FastCgiConfig -idle-timeout 100 -maxClassProcesses 1 -initial-env WT_APP_ROOT=/tmp
FastCgiServer /var/www/html/hello.wt
</IfModule>
get rid of the site configuration file for wt applications:
/etc/apache2/sites-enabled/wt.conf
because it has no effect on the process
reload apache
service apache2 reload
Now, when I type the address
localhost/hello.wt
in my browser, I can see the example displayed, assuming
/var/run/wt
could be created by the www-data user.

avahi_entry_group_new() failed: Too many objects

I'm working on making a REST API for my research lab's database. I'm using the Django REST framework and I've gotten everything running smoothly on my local machine. All my code is in its own branch in our Mercurial repo. When I switch branches on our server, the website crashes with:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root#localhost and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error
log.
The error logs on our server look like this:
[Tue Feb 03 12:55:56 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Feb 03 12:55:56 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Feb 03 12:55:56 2015] [notice] Digest: done
[Tue Feb 03 12:55:56 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Feb 03 12:56:11 2015] [error] avahi_entry_group_add_service_strlst("Lee on [server name]") failed: Local name collision
(this sort of error repeats many times)
[Tue Feb 03 12:56:13 2015] [error] avahi_entry_group_new() failed: Too many objects
(this error repeats many times.)
I've tried Googling the avahi errors to no avail. Anyone have any insight?
Because of the "too many objects" part of the error, I thought that it might somehow be related to not setting the pagination settings for the API. I only have a couple test objects on my local dev version of the database, but the actual database has tens of thousands. I set up pagination and tried again but it didn't change anything.
Turns out the culprit was not having the djangorestframework package installed for the correct version of Python on the server!? Hopefully this helps someone later down the line.

Django / Apache / mod_wsgi - WEB Application Hangs - Fails to Launch

My Django WEB Application fails to launch all of a sudden and out of the blues.
It was working fine until yesterday in production.
I am not able to figure out where the problem is. It could apache or mod_wsgi or windows but at the moment I have no clue.
I have tried to reinstall all the python libraries/prerequisites etc. but the problem persists nevertheless.
I am serving the WEBApp at Apache Port 8999 and When I access the WEB App, the browser fails to show any error. It just keeps trying to open the page and in the status bar I just see the Waiting for message.
If I see the netstat results then I see the following
C:\Documents and Settings\admintemp>netstat -an | find "8999" TCP
0.0.0.0:8999 0.0.0.0:0 LISTENING TCP 172.18.148.156:8999 10.107.226.88:1826 ESTABLISHED
This connection remains established forever and nothing happens. Internet Browser just seems to try to keep opening the Web App and it appears as if it is waiting forever.
The only thing i see in Apache logs is this
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
[Fri Jun 21 18:34:32 2013] [notice] Server built: Jan 28 2012 11:16:39
[Fri Jun 21 18:34:32 2013] [notice] Parent: Created child process 3876
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Jun 21 18:34:32 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Child process is running
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Acquired the start mutex.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting 64 worker threads.
[Fri Jun 21 18:34:32 2013] [notice] Child 3876: Starting thread to listen on port 8999.
[Fri Jun 21 18:34:43 2013] [error] C:/Program Files/App_Logic/logic_apps/logic_apps\\..\\logic_apps
I also noticed in the Windows Event Viewer logs (Application Logs) the following message but I am not sure how (and if) this could be related to my problem at hand. This message seems to shows up once for everytime i access the Web App.
Application popup: Microsoft Visual C++ Runtime Library : Runtime
Error!
Program: C:\Progr...
R6034 An application has made an attempt to load the C runtime library
incorrectly. Please contact the application's support team for more
information.
Exact screenshot of above error message is at http://imgur.com/hijiKv8
Please note that as part of my analysis I have tried
Accesing the apache page at http://127.0.0.1:8999 does show me the It Works ! message
Running the WEB App using the Django Development server and it launches fine.
Changing the wsgi.py file and when I introduce errors in the file deliberately, accessing the web app does complain with the relevant.
The application is installed on Windows Server 2003 SP1 and there are no automatic updates schedules on this machine so I am not suspecting that a update would have caused this problem. I also saw the Windows Update log and there was nothing installed recently.
The application is based on following Python Libraries as prerequisites
httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
python-2.7.3
Django-1.4.3
psycopg2-2.4.6.win32-py2.7-pg9.2.2-release
cx_Oracle-5.1.2-10g.win32-py2.7
PIL-1.1.7.win32-py2.7
python-ldap-2.4.10.win32-py2.7
south-0.7.6
xlrd-0.9.0
xlwt-0.7.5
mod_wsgi.so
I have tried with the WSGIApplicationGroup %{GLOBAL} directive and setting the log level to debug and info but the resulting logs don't give any additional information.
I have posted apache debug level log at http://dpaste.com/1268653/
I have posted apache info level log at http://dpaste.com/1268660/
Both these logs were taken after a fresh restart of apache and then the application hanging and until I stopped apache and copied the logs.
I also tried running the Hello World Application as documented at https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines and it worked fine.
I still remain clueless. Appreciate if you could guide me what else I could do to get more details of the issue.
Appreciate if someone could guide me with respect to what more I can do to solve this problem or get more information to get to the root of this.
I was able to solve this issue in the end.
The post at Runtime error R6034 in embedded Python application led me to a solution.
Thanks to Graham Dumpleton and others who were helping me offline to get this issue solved.
It was rather cheeky in the end, a conflicting version of msvcr90.dll
I removed the IBM Bit from the path and it works fine now.

Where are my 500s coming from in my DJango app?

I've got Apache setup on windows, (yes, not a very good idea, but not my fault). I open a popup window with about 32 images in it and all but 3 of those image links work. The images are coming from a TIF file and therefore have to be converted, so it is running thru my Django app to do all this and that part is working. The 3 urls that fail, when retried work.
In the apache log, I get 29 200s followed by 3 500s, but the actual images that failed to load are scattered randomly among the 29 good images. When I watch the log with tail -f, the 500s come along many seconds after the 200s but timestamped BEFORE them, like so:
192.168.20.45 - - [08/Mar/2012:01:24:28 -0600] "GET /viewer/... 200 44277
192.168.20.45 - - [08/Mar/2012:01:24:28 -0600] "GET /viewer/... 200 52283
192.168.20.45 - - [08/Mar/2012:01:24:28 -0600] "GET /viewer/... 200 44991
192.168.20.45 - - [08/Mar/2012:01:24:29 -0600] "GET /viewer/... 200 33077
192.168.20.45 - - [08/Mar/2012:01:24:22 -0600] "GET /viewer/... 500 16
192.168.20.45 - - [08/Mar/2012:01:24:22 -0600] "GET /viewer/... 500 16
192.168.20.45 - - [08/Mar/2012:01:24:22 -0600] "GET /viewer/... 500 16
DEBUG=False, and admins are setup, so I should get an email for every 500 that happens in Django, I've tested the email and it works as expected. The code I'm going thru has logging statements for error conditions and none of those are triggering.
It's almost like Apache or Mod_wsgi knows these connections come in, but never passes them to the Django code and they just end up dying from what seems to be a timeout. Chrome DevTools ends up showing me:
**Response Headers**
Connection:close
Content-Type:text/html; charset=utf-8
Date:Thu, 08 Mar 2012 07:24:22 GMT
Server:Apache/2.2.21 (Win32) mod_wsgi/3.3 Python/2.7.2
Set-Cookie:sessionid=d4616w0f850u1eb33q7a6fzf37f840b5; Path=/
Transfer-Encoding:chunked
Vary:Cookie
I'm on windows, and Apache says this on startup:
[Thu Mar 08 01:38:09 2012] [warn] mod_wsgi: Compiled for Python/2.7.
[Thu Mar 08 01:38:09 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Thu Mar 08 01:38:09 2012] [notice] Apache/2.2.21 (Win32) mod_wsgi/3.3 Python/2.7.2 configured -- resuming normal operations
[Thu Mar 08 01:38:09 2012] [notice] Server built: Sep 9 2011 10:26:10
[Thu Mar 08 01:38:09 2012] [notice] Parent: Created child process 3260
[Thu Mar 08 01:38:09 2012] [warn] mod_wsgi: Compiled for Python/2.7.
[Thu Mar 08 01:38:09 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Thu Mar 08 01:38:09 2012] [notice] Child 3260: Child process is running
[Thu Mar 08 01:38:09 2012] [notice] Child 3260: Acquired the start mutex.
[Thu Mar 08 01:38:09 2012] [notice] Child 3260: Starting 64 worker threads.
[Thu Mar 08 01:38:09 2012] [notice] Child 3260: Starting thread to listen on port 80.
There are less than 64 requests so there should be threads left over to handle them.
Any ideas on WHAT is happening? or HOW to figure it out?
EDIT----
There is no traceback, that is the problem. There is no indication at all that Python ever saw this request.
Yes, you shouldn't use python to serve static files, but you can't put a single image TIFF from a multi image TIFF into an you have to pull it from the multi-image file, put it in a format the browser can display, and no you don't want to convert the 100+ million TIFF images into single image PNGs or JPEG. AND these are not images that can be viewed by the general public, but are restricted to their "owners"
Loaded this on a second machine and the problem does not happen.....
You can write a small middleware to handle the exception. You can do some logging in the process_exception method, to find the root of the problem:
https://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception