Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mod-wsgi in apache
#1
i am playing around with mod-wsgi in apache. it seems to be working ok. a difficulty is when my code has an error. there are about 3 different places i need to look at to see where the right messages how up. the web page itself doesn't display anything but that there is a "system error". i am thinking through how to get the programming error messages into place that makes it easier for the developers to find.

everything seems to run in the apache process. i remember doing CGI and it ran in a subprocess. i'm not sure which way is better. the process under wsgi exits the process when done and then apache must start a new one. i worry that this ends up recycling too many processes and thus is not really any better than CGI and may even be a bit worse (the number of listeners goes down as connections are processed).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
(Jul-06-2017, 03:08 AM)Skaperen Wrote: i am playing around with mod-wsgi in apache. it seems to be working ok. a difficulty is when my code has an error. there are about 3 different places i need to look at to see where the right messages how up. the web page itself doesn't display anything but that there is a "system error". i am thinking through how to get the programming error messages into place that makes it easier for the developers to find.
Why would you be looking in 3 different places? If you have any traceback whatsoever in your code that causes an internal server error. All you need to do is tail the apache error log and you will see the traceback pop up when you visit the page that causes the 500 error every time you refresh the page. It depends on where you setup apache error logs to be, etc. for the exact location. But the command i give to view errors in ubuntu doing CGI/WSGI is
sudo tail -f  /var/log/apache2/error.log
and i usually have this up in a tmux session split between two terminals, one for errors, and one for Vim for coding all split to half screen for a browser on the other side to see what the actual appearance looks like.


The rest i dont know and will let others comment about.
Recommended Tutorials:
Reply
#3
the traceback does not always show up in the apache error log. that and it's not always a traceback. and for what does go to the apache error log i have to filter it from the flood of other crap from people trying to break in. i am thinking of making a layer that runs other stuff after setting up all output to a unique file.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
(Jul-09-2017, 06:43 AM)Skaperen Wrote: i have to filter it from the flood of other crap
If you switch to LogLevel error you wont have a lot in there.

(Jul-09-2017, 06:43 AM)Skaperen Wrote: the traceback does not always show up in the apache error log. that and it's not always a traceback.
Anything resulting in an internal server error will show up in the error logs which is any python related error. Anything else would be an apache issue and not a python issue. That and you need to make sure that the files are executable, correct permissions, and in the directory that apache is assigned as wsgi executable.
(Jul-06-2017, 03:08 AM)Skaperen Wrote: there is a "system error".
Whatever is causing your system error should also be in the error logs giving you an indication of the problem.
Recommended Tutorials:
Reply
#5
by "a lot of other crap" i mean other, unrelated, log messages, like Putin trying to find weak passwords on my server. i have had cases where the traceback showed up in other files (due to me trying to separate this from the mess of other log messages).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  mod-wsgi Skaperen 2 3,828 Jun-06-2017, 05:12 AM
Last Post: Skaperen
  WSGI vs CGI Skaperen 9 12,185 Jun-01-2017, 05:39 AM
Last Post: Skaperen
  WSGI working examples Skaperen 1 3,486 May-29-2017, 10:45 AM
Last Post: snippsat
  trying to figure out WSGI Skaperen 10 7,836 Apr-30-2017, 10:00 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020