apache2

Can't execute python script from PHP (apache2)

Can't execute python script from PHP (apache2) Question: I want to execute Python script from PHP file using apache2 on my macos. I am able to execute simple python script like: From PHP: $result = shell_exec(“python /Library/…./example.py ‘$name’ ‘$email’ ”); var_dump($result); To Python import sys x = sys.argv[1] y = sys.argv[2] print(“name: ” + x …

Total answers: 2

Python script does not run through CGI on Apache2

Python script does not run through CGI on Apache2 Question: I am using apache2 version Apache/2.4.23 I created a simple python script that I want executed via CGI. The script does not execute when I open http://localhost/cgi-bin/hello.py. Instead, I just see the python code in the script: The script looks like so: #!/usr/local/bin/python print “Python …

Total answers: 2

How to install & configure mod_wsgi for py3

How to install & configure mod_wsgi for py3 Question: I installed & configured mod_wsgi for python2.7 but now I would also like to have mod_wsgi for py3 I’m in ubuntu 12.04 My apache conf file looks like this for py2.7 : <Directory /var/www/vhosts/my_web> WSGIProcessGroup my_web WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> Now I …

Total answers: 3

Standard 401 response when using HTTP auth in flask

Standard 401 response when using HTTP auth in flask Question: In flask, I’m using the following snippet to enable HTTP auth: def authenticate(): return Response(‘<Why access is denied string goes here…>’, 401, {‘WWW-Authenticate’:’Basic realm=”Login Required”‘}) Now, in my past experience with Flask, if someone’s credentials are incorrect and I want to let them know I …

Total answers: 2

Multiple mod_wsgi apps on one virtual host directing to wrong app

Multiple mod_wsgi apps on one virtual host directing to wrong app Question: I’m trying to get two (or more) Django applications set up at subdirectories under the same domain, e.g.: http://example.com/site1/ http://example.com/site2/ I know that normally this works fine by setting up an apache virtualhost like this: <VirtualHost *:80> … WSGIScriptAlias /site1 /path/to/site1.wsgi WSGIScriptAlias /site2 …

Total answers: 4

CoreDumpDirectory isn't working on ubuntu; getting segmentation fault in apache2 error log

CoreDumpDirectory isn't working on ubuntu; getting segmentation fault in apache2 error log Question: I am not able to log the apache2 crashes in CoreDumpDirectory on ubuntu 10.10. I am using Django 1.2.3 and apache2 with mod_wsgi. I followed the steps listed in response to this question but to no avail. I added – CoreDumpDirectory /var/cache/apache2/ …

Total answers: 2

multiple django sites with apache & mod_wsgi

multiple django sites with apache & mod_wsgi Question: I want to host several sites with under the same server which uses Debian 5, say I have site1, site2 and site3, and assume my ip is 155.55.55.1: site1: 155.55.55.1:80 , script at /opt/django/site1/ site2: 155.55.55.1:8080, script at /opt/django/site2/ site3: 155.55.55.1:8090, script at /opt/django/site3/ Here is my …

Total answers: 2