08-02-2023, 04:19 PM
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 (
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 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]
?