Deployment 无法使用apache2 mod_wsgi设置odoo
我在ubunu 18.04(apache2)上安装odoo v13时遇到问题 我已经能够通过odoo bin进行测试/开发,但试图从我的本地机器上实现 (我们的网络上有一个代理,但现在我想让它运行,这样我就可以得到它) 我设置了odoo.conf来吐出错误odoo-error.log它确实会吐出一些错误。但仅在系统CTL重新启动apache2后 然后它停止了 从守护进程接收的响应标头被截断或过大 “admin':/opt/odoo13/E-Forms/odoo/setup/odoo-wsgi.py 我已经完成了目录的所有权限访问 但我发现apache的奇怪之处在于,在默认错误文件中 致命的Python错误:Py_初始化:无法获取区域设置编码 ModuleNotFoundError:没有名为“encodings”的模块 如果我告诉virtualhost他们把我所有的错误都放在了odoo-error.log上为什么error.log仍然不断被填充,但我想这与我的问题无关 这是我的密码Deployment 无法使用apache2 mod_wsgi设置odoo,deployment,apache2,odoo,mod-wsgi,odoo-13,Deployment,Apache2,Odoo,Mod Wsgi,Odoo 13,我在ubunu 18.04(apache2)上安装odoo v13时遇到问题 我已经能够通过odoo bin进行测试/开发,但试图从我的本地机器上实现 (我们的网络上有一个代理,但现在我想让它运行,这样我就可以得到它) 我设置了odoo.conf来吐出错误odoo-error.log它确实会吐出一些错误。但仅在系统CTL重新启动apache2后 然后它停止了 从守护进程接收的响应标头被截断或过大 “admin':/opt/odoo13/E-Forms/odoo/setup/odoo-wsgi.p
ServerName test.eforms.com
ServerAlias test.eforms.com 127.0.0.1
ErrorLog ${APACHE_LOG_DIR}/odoo-error.log
CustomLog ${APACHE_LOG_DIR}/odoo-access.log combined
LogLevel info
<Directory /opt/odoo13/E-Forms>
Require all granted
</Directory>
<Directory /opt/odoo13/E-Forms/odoo/setup>
<Files odoo-wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess admin user=admin group=admin processes=1 python-home=/opt/odoo13/Venv/odoovenv/bin/ python-path=/opt/odoo13/E-Forms/odoo
WSGIProcessGroup admin
WSGIScriptAlias / /opt/odoo13/E-Forms/odoo/setup/odoo-wsgi.py
WSGIApplicationGroup %{GLOBAL}
</VirtualHost>
还有我的apache2.conf
ServerName test.eforms.com
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 900
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups On
ErrorLog ${APACHE_LOG_DIR}/error.log
#LogLevel info
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LoadModule wsgi_module modules/mod_wsgi.so
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# see README.Debian for details.
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
ServerName test.eforms.com
DefaultRuntimeDir${APACHE\u RUN\u DIR}
PidFile${APACHE_PID_文件}
超时900
继续
MaxKeepAliveRequests 100
保持超时
用户${APACHE\u RUN\u User}
组${APACHE\u RUN\u Group}
主机名查找
ErrorLog${APACHE_LOG_DIR}/error.LOG
#日志级别信息
#包括模块配置:
包括可选mods启用/*.加载
IncludeOptional mods enabled/*.conf
#包括要侦听的端口列表
Include ports.conf
选项如下符号链接
不允许超限
要求全部拒绝
不允许超限
要求所有授权
选项索引跟随符号链接
不允许超限
要求所有授权
AccessFileName.htaccess
要求全部拒绝
LoadModule wsgi_modules/mod_wsgi.so
日志格式“%v:%p%h%l%u%t\%r\“%>s%O\”%{Referer}i\“\”%{User-Agent}i\\”vhost\u
日志格式“%h%l%u%t\%r\”%>s%O\“%%{Referer}i\\\“%%{User Agent}i\\”组合
日志格式“%h%l%u%t\%r\“%>s%O”通用
日志格式“%{Referer}i->%U”Referer
日志格式“%{User agent}i”代理
#有关详细信息,请参见自述文件.Debian。
IncludeOptional conf enabled/*.conf
IncludeOptional sites enabled/*.conf
#vim:syntax=apachets=4sw=4sts=4srnoet
我从源代码下载了mod_wsgi.so并安装了它
以下是仅针对apache2安装的所有apt软件包的列表
apache2/仿生更新,仿生安全,现在是2.4.29-1ubuntu4.11 amd64
[已安装]apache2 bin/仿生更新,仿生安全,现在
2.4.29-1ubuntu4.11 amd64[已安装,自动]apache2数据/仿生更新,仿生更新,仿生安全,仿生安全,立即
2.4.29-1ubuntu4.11所有[已安装,自动]apache2开发/仿生更新,仿生安全,现为2.4.29-1ubuntu4.11
amd64[已安装]apache2 utils/仿生更新,仿生安全,现在
2.4.29-1ubuntu4.11 amd64[已安装,自动]libapache2-mod-wsgi-py3/bionic,现为4.5.17-1 amd64[已安装]
我的皮普冻住了
Babel==2.3.4 certifi==2019.9.11 chardet==3.0.4 decorator==4.0.10
Django==2.2.6 docopt==0.6.2 docutils==0.12 h11==0.8.1 h2==3.1.1
hpack==3.0.0 html2text==2019.9.26超帧==5.2.0 idna==2.8
image==1.5.27 Jinja2==2.10.3 libsass==0.19.3 lxml==4.4.1
MarkupSafe==1.1.1 num2words==0.5.10 passlib==1.7.1枕头==6.2.0
pkg资源==0.0.0 polib==1.1.0 psutil==5.6.3 psycogreen==1.0.1
psycopg2==2.8.4 psycopg2二进制==2.8.4 pyasn1==0.4.7
pyasn1模块==0.2.7 pyldap==3.0.0.post1 PyPDF2==1.26.0
python dateutil==2.8.0 python ldap==3.2.0 python openid==2.2.5
python stdnum==1.11 pytz==2016.7 reportlab==3.5.28请求==2.22.0
rfc3986==1.3.2six==1.12.0SQLParse==0.3.0URLLIB3==1.25.6
Werkzeug==0.16.0 xlwt==1.3.0
经过三天的苦思冥想,我终于发现了问题所在,就是这一行 python home=/opt/odoo13/Venv/odoovenv/bin/ 这应该是哪一个 python home=/opt/odoo13/Venv/odoovenv/ 所以将来有人遇到这样的问题,这里有一些建议
- 仔细检查您的mod_wsgi是否使用与之相同的python版本 你的虚拟世界
- 确保更新所有软件包(我使用ubuntu,所以 那很合适)
- 确保wsgiprocessgroup具有目录和子目录的所有rwx 托管应用程序的目录(可能不写)
ServerName test.eforms.com
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 900
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups On
ErrorLog ${APACHE_LOG_DIR}/error.log
#LogLevel info
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LoadModule wsgi_module modules/mod_wsgi.so
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# see README.Debian for details.
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet