我正在尝试部署 Django 应用程序,但遇到了障碍。在 Debian(最新)上,到目前为止我已经运行了这些命令:
apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-python python-django
Run Code Online (Sandbox Code Playgroud)
我已经尝试在 Apache 2 配置文件中手动添加模块,但老实说我完全迷失了。它与我多年前使用的 Apache 版本 1 完全不同。
Syntax error on line 7 of /etc/apache2/sites-enabled/000-default:
Invalid command 'PythonHandler', perhaps misspelled or defined by a module not included in the server configuration
Run Code Online (Sandbox Code Playgroud)
我已将以下内容添加到我的sites-available/default文件中的标签之间。
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE hellodjango1.settings
PythonDebug Off
</Location>
Run Code Online (Sandbox Code Playgroud)
以下是我到目前为止使用过的教程,但运气不佳:
我在我的 Ubuntu/Apache Web 服务器上运行了一些 Trac 安装,我注意到当我在访问 Trac 页面时监视 CPU 使用率时,CPU 飙升至 100% 的情况并不少见。我担心只有一个用户访问系统时会发生这种情况。
有什么方法可以减少在我的 Web 服务器上访问 Trac 的 CPU 密集度?
如何为 mod_python 或 mod_wsgi 配置 ISPConfig 以进行类似 django 的应用程序部署?