1

Note: I'm very new to Apache, so I may just need a simple tip.

I've successfully followed the instructions at https://pypi.python.org/pypi/mod_wsgi to set things up so I have an empty Django project being served over port 80 on an AWS Linux AMI EC2 server using mod_wsgi. I use this command to start serving the Django project:

python manage.py runmodwsgi --setup-only --port=80 --user apache --group apache --server-root=/etc/mod_wsgi-express-80

This seems to create a separate Apache instance with its own configuration that only serves the Django project, independent of the system Apache installation.

However, I also want to be able to serve phpMyAdmin, say on port 81, but I'm not sure which Apache instance I'm supposed to modify (and the httpd.conf for the mod_wsgi instance is very different from the default). How should I configure my virtual hosts (and which instance should I be modifying) so that going to <ip-address>:81/phpmyadmin gives me access to phpMyAdmin?

Currently, going to that address just times out. Going to <ip-address> gives me the "It worked!" page as expected.

My current modifications to my main httpd.conf:

Listen 81

Include sites-enabled/*.conf

WSGIScriptAlias /process /home/ec2-user/test/test_site/test_site/wsgi.py

WSGIPythonPath /home/ec2-user/test:/home/ec2-user/.virtualenvs/venv/lib/python3.5/site-\packages

<Directory /home/ec2-user/test/test_site/test_site>
<Files wsgi.py>
Order deny,allow
Allow from all
Require all granted
</Files>
</Directory>

ExtendedStatus On

Options -Indexes FollowSymLinks

The .conf file to serve phpMyAdmin (is there just something missing here?)

<VirtualHost *:81>
  ServerName phpmyadmin
  DocumentRoot /var/www-81 #symlinked to '/usr/share/phpMyAdmin'
</VirtualHost>
Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • As the mod-wsgi doc you link to shows, that package is meant as an easy way of setting up the module along with Apache. But as it also explains, you can install the standard mod_wsgi module within your existing Apache installation and configure it manually, as shown in both the Django and mod_wsgi docs. – Daniel Roseman Jun 16 '17 at 15:44
  • I had done that initially and had issues, so I turned to running the standalone instance. Turns out that I was using a mod_wsgi.so compiled against the wrong python version. Used the basic vhost config here https://modwsgi.readthedocs.io/en/develop/user-guides/quick-configuration-guide.html and got things working without even using separate ports! Thanks for giving me a nudge to try that again. – Arnab Banerji Jun 16 '17 at 19:01
  • You could use mod_wsgi-express which doesn't get in the way of your PHP setup – Sunday Ikpe Jan 16 '18 at 17:26

1 Answers1

0

Read the blog post which talks about using mod_wsgi and PHP at same time:

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • Thanks, Graham! I basically already figured out how to separate the applications URL-wise (I don't care that they're not both at the root of the site), but I'll definitely be changing the configuration to ensure that Django is running daemonized. – Arnab Banerji Jun 18 '17 at 01:15