buntu的Apache网络服务器上运行Django和phpMy

buntu的Apache网络服务器上运行Django和phpMy

本文介绍了如何在Ubuntu的Apache网络服务器上运行Django和phpMyAdmin的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何运行的Django和Apache网络服务器的phpmyadmin。我用本地主机/ phpmyadmin的,它的工作,但后,我在localhost /管理员配置的Django,phpMyAdmin是不是我的工作从Django中得到一个错误页面,指出该URL不在urls.py.有没有办法通过端口81(httpd.conf)中运行Django的,这样就不会与phpMyAdmin冲突,或者是有别的东西,我很missing.I使用了mod_python模块。这是我的httpd.conf文件时,我改变位置/到位置/家庭/项目/phpMyAdmin的工作,但Django的失败,反之亦然。

 <位置/>
 SetHandler蟒蛇程序
 PythonHandler django.core.handlers.modpython
 SETENV DJANGO_SETTINGS_MODULE hana.settings
 PYTHONPATH['/家庭/项目/','/家庭/项目/ mysite的','/家庭/项目/ mysite的/ mysite的'] + sys.path的
< /地点>
<位置/管理媒体>
SetHandler无
< /地点>


解决方案

您可以在同一端口上运行它们。刚过 WSGIAlias​​ 添加这些行到你的Apache配置指令:

 别名/ phphmyadmin / SYS /路径/要/ phpMyAdmin的
<位置/ phphmyadmin>
SetHandler无
< /地点>

您也可以在不同的端口上运行它们。

 收听80
听81
*了NameVirtualHost:80
*了NameVirtualHost:81<虚拟主机*:81>
Django的配置
< /虚拟主机><虚拟主机*:80>
phph - 我的管理员,CONFIGS
< /虚拟主机>

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 phpmyadmin, 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>

这篇关于如何在Ubuntu的Apache网络服务器上运行Django和phpMyAdmin的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 12:13