开发者

How do i run Django and phpmyadmin on apache webserver on ubuntu

How do i run Django and phpmyadmin on apache webserver. I used localhost/phpmyadmin and it worked but after i configured Django on localhost/admin, phpmyadmin is not working i get an error page from Django saying the URL is not in urls.py. is there a way to run Django on port 81(httpd.conf) so that it will not conflict with phpmya开发者_运维问答dmin, or is there something else i am missing.I use mod_python module.This is my httpd.conf file when i change the location "/" to location "/home/projects/" Phpmyadmin works but Django fails and viceversa

<location "/">
 SetHandler python-program
 PythonHandler django.core.handlers.modpython
 SetEnv DJANGO_SETTINGS_MODULE hana.settings
 PythonPath "['/home/projects/', '/home/projects/mysite', '/home/projects/mysite/mysite'] + sys.path"
</location>
<location "/admin-media">
SetHandler None
</location>


You can run them both on same port. Just add these lines to your apache config after WSGIAlias directive:

Alias /phphmyadmin /sys/path/to/phpmyadmin
<Location /phphmyadmin>
SetHandler None
</Location>

You can also run them on different ports.

Listen 80
Listen 81
NameVirtualHost *:80
NameVirtualHost *:81

<VirtualHost *:81>
django-config
</VirtualHost>

<VirtualHost *:80>
phph-my-admin-configs
</VirtualHost>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜