I am trying to run PHP and Django on same Apache server. PHP site is running fine but when I point to Djnago App’s url, it shows directory structure only. Any help is greatly appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I have two .conf files in /etc/apache2/sites-available/
DocumentRoot /var/www/html
<Directory /var/www/html/> Order deny,allow Allow from all </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LogLevel debug </VirtualHost>
additional.conf <VirtualHost IP:80> ServerAdmin admin@domain_name DocumentRoot /var/www/html/qa ServerName domain_name
Alias /m/ /var/www/html/qa/static/ Alias /upfiles/ /var/www/html/qa/askbot/upfiles/ <DirectoryMatch “/var/www/html/qa/askbot/skins/([^/]+)/media”> Order deny,allow Allow from all </DirectoryMatch> <Directory “/var/www/html/qa/askbot/upfiles”> Order deny,allow Allow from all </Directory> <Directory “/var/www/html/qa/ask-skins”> Order deny,allow Allow from all </Directory>
<Directory “/var/www/html/qa/static”>
Order deny,allow
Allow from all
</Directory>
#must be a distinct name within your apache configuration
WSGIDaemonProcess askbot2
WSGIProcessGroup askbot2
WSGIScriptAlias / /var/www/html/qa/django.wsgi
<Directory /var/www/html/qa> <Files django.wsgi> Order deny,allow Allow from all </Files> </Directory>
<LocationMatch “/admin(?!/media)”> RewriteEngine on RewriteRule /admin(.*)$ http://domain_name/admin$1 [L,R=301] </LocationMatch> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LogLevel debug </VirtualHost>
What’s your current configuration look like? (i.e. both VirtualHosts + any additional configuration that you’ve done)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.