我如何在 ubuntu 上的 apache 网络服务器上运行 Django 和 phpmyadmin
我如何在 apache 网络服务器上运行 Django 和 phpmyadmin。我使用 localhost/phpmyadmin 并且它工作了,但是在 localhost/admin 上配置 Django 后,phpmyadmin 不工作,我从 Django 收到一个错误页面,说 URL 不在 urls.py 中。有没有办法在端口 81(httpd.conf) 上运行 Django,这样它就不会与 phpmyadmin 冲突,或者我还缺少其他内容。我使用 mod_python 模块。这是我更改位置时的 httpd.conf 文件“/”到位置“/home/projects/” Phpmyadmin 可以工作,但 Django 失败,反之亦然
<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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在同一端口上运行它们。只需将这些行添加到您的 apache 配置中的
WSGIAlias
指令之后即可:您还可以在不同的端口上运行它们。
You can run them both on same port. Just add these lines to your apache config after
WSGIAlias
directive:You can also run them on different ports.