php - Multiple frameworks on one URL with Apache -
note: urls, usernames, etc. have been changed privacy.
i designing api in flask, website in php. changed, moment both run side side on same url, call domain.com. flask api should located @ www.domain.com/api , php website @ www.domain.com.
the apache file websites located at: /etc/apache2/sites-available/domain.com. using 1 of individual settings below , restarting apache, can framework run alone, have not figured out how them both in file , running without issues.
flask (www.domain.com/api):
<virtualhost *:80> serveradmin webmaster@domain.com servername www.domain.com wsgidaemonprocess api user=www-data group=www-data threads=5 wsgiscriptalias /api /home/user/public_html/api/api.wsgi <directory /home/user/public_html/api> wsgiprocessgroup api wsgiapplicationgroup %{global} order deny,allow allow </directory> </virtualhost>
php (www.domain.com):
<virtualhost *:80> serveradmin webmaster@domain.com servername www.domain.com directoryindex index.php documentroot /home/user/public_html/domain.com/ </virtualhost>
i have experimented number of things directory , alias, have not been able find solution yet.
the answer pretty simple when discovered wsgiscriptalias works alias. can combine 2 , works how want to.
<virtualhost *:80> serveradmin webmaster@domain.com servername www.domain.com directoryindex index.php documentroot /home/user/public_html/domain.com/ wsgidaemonprocess api user=www-data group=www-data threads=5 wsgiscriptalias /api /home/user/public_html/api/api.wsgi <directory /home/user/public_html/api> wsgiprocessgroup api wsgiapplicationgroup %{global} order deny,allow allow </directory> </virtualhost>
Comments
Post a Comment