I've had a Flask/WSGI app running just fine on an Apache host for the last year. The httpd.conf is set up like this:
ServerName myapp.com
WSGISocketPrefix /var/run/wsgi
WSGIScriptAlias / /var/www/myapp/myapp/myapp.wsgi
WSGIDaemonProcess myapp user=user group=user threads=5
<Directory /var/www/myapp/myapp>
WSGIProcessGroup myapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^/?(.*)$ https://www.myapp.com/$1 [R=301,L]
So you go to https://myapp.com or https://myapp.com/blah and it works fine.
My client now wants to set up a Wordpress blog for the site which would live at blog.myapp.com. My Apache is weak so I'm not sure how to properly do this. Here's what I tried in httpd.conf:
WSGISocketPrefix /var/run/wsgi
NameVirtualHost *:80
<VirtualHost *:80>
ServerName myapp.com
WSGIScriptAlias / /var/www/myapp/myapp/myapp.wsgi
WSGIDaemonProcess myapp user=user group=user threads=5
<Directory /var/www/myapp/myapp>
WSGIProcessGroup myapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^/?(.*)$ https://www.myapp.com/$1 [R=301,L]
</VirtualHost>
<VirtualHost *:80>
ServerName blog.myapp.com
DocumentRoot "/var/www/html/wordpress"
</VirtualHost>
The HTTPD service restarts without a problem, but when I go to http://myapp.com I get the Apache test page. Is it possible to do what my client wants?