System environment description
System: CentOS-8.2.2004
Platform:x86-64
Tools used to install
git
installation
dnf install git
software download
Compile and install, source code acquisition
git clone https://github.com/kimchi-project/wok.git
The source code github
is slow to check out. You can use domestic mirror acceleration. For domestic mirror acceleration methods, see Github Domestic mirror acceleration . For accelerated mirroring, see GitHub accelerated mirroring.
Dependent installation
Compile dependent installation
wok
Compile need automake
, gcc
, make
and other dependent
dnf install automake gcc make
pip3 install pyflakes
Run dependency installation
dnf install python36-devel openldap-devel nginx
pip3 install cherrypy python-ldap python-pam Cheetah3 lxml psutil jsonschema
pip3 install websockify==0.7.0
wok
installation
cd wok
git checkout 3.0.0
./autogen.sh --system
make
make install
Configurationwok
- Turn off SELinux
# 永久关闭/启动:修改/etc/sysconfig/selinux后重启系统
vim /etc/sysconfig/selinux # 将“SELINUX=enforcing“改成“SELINUX=desabled”
- The firewall allows access to the port, and wok uses port 8001 by default. For common firewall operations, see centos8 firewall common operations
firewall-cmd --add-port=8001/tcp --permanent
firewall-cmd --reload
- Set boot up
systemctl enable wokd
Enable development mode debugging
python3 /bin/wokd --environment=dev
wok
Plug-in installation
kimchi
Installation, see kimchi installation and deployment on CentOS8
common problem
Compilation problem
- The execution
./autogen.sh --system
reported the following error
./autogen.sh: line 23: aclocal: command not found
./autogen.sh: line 24: automake: command not found
./autogen.sh: line 25: autoreconf: command not found
Solution: missing automake
tools
dnf install automake
- The error message is as follows
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
Solution: missinggcc
dnf install gcc
- The error message is as follows
configure.ac:59: error: required file 'build-aux/compile' not found
configure.ac:59: 'automake --add-missing' can install 'compile'
configure.ac:59: error: required file 'build-aux/config.guess' not found
configure.ac:59: 'automake --add-missing' can install 'config.guess'
configure.ac:59: error: required file 'build-aux/config.sub' not found
configure.ac:59: 'automake --add-missing' can install 'config.sub'
Solution:
automake --add-missing
- The error message is as follows
checking whether make sets $(MAKE)... no
Solution: missingmake
dnf install make
- The error message is as follows
checking for pyflakes... no
configure: WARNING: pyflakes not found
Solution:
pip3 install pyflakes
Running problem
- The error message is as follows
ModuleNotFoundError: No module named 'cherrypy'
Solution:
pip3 install cherrypy
- The error message is as follows
ModuleNotFoundError: No module named 'ldap'
Solution: An error occurred during the installation process, see python common error handling [CentOS8 system] (pip installation application)
pip3 install python-ldap
- The error message is as follows
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/wok/auth.py", line 34, in <module>
import PAM
ModuleNotFoundError: No module named 'PAM'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bin/wokd", line 30, in <module>
import wok.server
File "/usr/lib/python3.6/site-packages/wok/server.py", line 28, in <module>
from wok import auth
File "/usr/lib/python3.6/site-packages/wok/auth.py", line 36, in <module>
import pam as PAM
ModuleNotFoundError: No module named 'pam'
Solution:
pip3 install python-pam
- The error message is as follows
ModuleNotFoundError: No module named 'Cheetah'
Solution:
pip3 install Cheetah3
- The error message is as follows
ModuleNotFoundError: No module named 'lxml'
Solution:
pip3 install lxml
- The error message is as follows
ModuleNotFoundError: No module named 'psutil'
Solution:
pip3 install psutil
- The error message is as follows
ModuleNotFoundError: No module named 'websockify'
Solution: 注意
: kimchi
use the latest version websockify
there is a problem
pip3 install websockify==0.7.0
- The error message is as follows
ModuleNotFoundError: No module named 'jsonschema'
Solution:
pip3 install jsonschema
- The error message is as follows
rc: 4 error: Redirecting to /bin/systemctl status nginx.service
Unit nginx.service could not be found.
returned from cmd: service nginx status
Redirecting to /bin/systemctl start nginx.service
Failed to start nginx.service: Unit nginx.service not found.
Solution:
dnf install nginx
Configuration problem
- The error message is as follows
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
After execution systemctl status nginx.service
, the error message is displayed as follows
Oct 23 21:57:03 kimchi nginx[63332]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Oct 23 21:57:03 kimchi nginx[63332]: nginx: [emerg] bind() to 0.0.0.0:8001 failed (13: Permission denied)
Oct 23 21:57:03 kimchi nginx[63332]: nginx: configuration file /etc/nginx/nginx.conf test failed
Execute the tail -100f /var/log/nginx/error.log
command to view the log error information, the error information is displayed as follows
63706#0: bind() to 0.0.0.0:8001 failed (13: Permission denied)
Solution: The cause of the problem is that SELinux intercepts Nginx requests by default based on the principle of least privilege, which can be solved by turning off SELinux
# 临时关闭 SELinux
setenforce 0
# 临时启动
SELinux:setenforce 1
# 永久关闭/启动:修改/etc/sysconfig/selinux后重启系统
vim /etc/sysconfig/selinux # 将“SELINUX=enforcing“改成“SELINUX=desabled”