Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 872 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running a flask website in a subdirectory with apache

#1
I'm using apache on my personal server, and I'm trying to run a 'main' website made with `Silex` on `www.mydomain.com/` and another one made using `Flask` on `www.mydomain.com/something`

To run the `Flask` website I'm using mod_wsgi as explained on their official website (

[To see links please register here]

).

It works just fine, I can reach my website at `www.mydomain.com/something`, but when I go back to `www.mydomain.com/` I get a `Flask` 404 error message.

I've tried checking the `apache` doc about virtual hosts but I can't make sense of it, here is my current `'sites-enabled/defaults'` configuration file :

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

WSGIDaemonProcess bc user=bc group=bc threads=5
WSGIScriptAlias / /var/www/bc/bc.wsgi
<Directory /var/www/bc>
WSGIProcessGroup bc
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

my `/var/www` directory looks like this :

./index.php

./bc/

./bc/index.py

How can I get the python website to only work in

[To see links please register here]

and let the PHP one run on

[To see links please register here]

?
Reply

#2
The first parameter to `WSGIScriptAlias` is the [url path], by specifying `WSGIScriptAlias / <foo>` you're telling apache to send all requests to the WSGI app. Try `WSGIScriptAlias /something <foo>`

[url path]:http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIScriptAlias
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through