0

Hello i have a problem configuring apache with Virtualhosts and ModWSGI, see i want to run a Python Script when i access to the domain, but it keeps showing me the content of my folder instead executing the script.

Here is the site-enabled configuration:

#

*.karinapp.com (/etc/httpd/sites-available/karinapp.com)

# ServerAdmin info@websergroup.com ServerName karinapp.com ServerAlias *.karinapp.com

    #Indexes + Directory Root
DocumentRoot /var/www/vhosts/karinapp.com/
<Directory "/var/www/vhosts/karinapp.com/Suite">
    AddHandler wsgi-script .wsgi
    AllowOverride All
    Options +Indexes FollowSymLinks +ExecCGI
    Order allow,deny
    Allow from all
</Directory>
    #LOG FILES
    ErrorLog  /var/www/vhosts/karinapp.com/logs/error.log
    CustomLog /var/www/vhosts/karinapp.com/logs/access.log combined

This is the code of the .htaccess that is on the Suite folder

ErrorDocument 400 /errors/badrequest.html

ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
allow from all
DirectoryIndex /Suite/Gate.py
hidura
  • 115
  • 5

1 Answers1

0

You need to check few things .. In your httpd.conf LoadModule should be enabled ti execute your cgi files.(wsgi is nothing but a cgi file only, a script)

Change your Directory Options

<Directory "/var/www/vhosts/karinapp.com/Suite">
AddHandler wsgi-script .wsgi
AllowOverride All
Options +ExecCGI FollowSymLinks +Indexes
Order allow,deny
Allow from all</Directory>

Becuse it executes it in left to right manner ,its like a or statement . Hope this helps..