在 mod_wsgi 后安装 API¶
安装 Apache 服务
Fedora 21/RHEL7/CentOS7: sudo yum install httpd Fedora 22 (or higher): sudo dnf install httpd Debian/Ubuntu: apt-get install apache2
将
etc/apache2/watcher.conf复制到 apache 站点目录下Fedora/RHEL7/CentOS7: sudo cp etc/apache2/watcher /etc/httpd/conf.d/watcher.conf Debian/Ubuntu: sudo cp etc/apache2/watcher /etc/apache2/sites-available/watcher.conf
根据安装和环境编辑
<apache-configuration-dir>/watcher.conf。修改
WSGIDaemonProcess指令,将user和group值设置为服务器上的适当用户。修改
WSGIScriptAlias指令,指向 watcher/api/app.wsgi 脚本。修改
Directory指令,设置 Watcher API 代码的路径。修改
ErrorLog 和 CustomLog,将日志重定向到正确的目录。
启用 apache watcher 站点并重新加载
Fedora/RHEL7/CentOS7: sudo systemctl reload httpd Debian/Ubuntu: sudo a2ensite watcher sudo service apache2 reload