[Operation and maintenance] Install and deploy wok on CentOS8 system

System environment description

System: CentOS-8.2.2004
Platform:x86-64

Tools used to install

  1. gitinstallation
dnf install git

software download

Compile and install, source code acquisition

git clone https://github.com/kimchi-project/wok.git

The source code githubis 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

wokCompile need automake, gcc, makeand 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

wokinstallation

cd wok
git checkout 3.0.0
./autogen.sh --system
make 
make install

Configurationwok

  1. Turn off SELinux
# 永久关闭/启动:修改/etc/sysconfig/selinux后重启系统
vim /etc/sysconfig/selinux # 将“SELINUX=enforcing“改成“SELINUX=desabled”
  1. 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
  1. Set boot up
systemctl enable wokd

Enable development mode debugging

python3 /bin/wokd --environment=dev

wokPlug-in installation

  1. kimchiInstallation, see kimchi installation and deployment on CentOS8

common problem

Compilation problem

  1. The execution ./autogen.sh --systemreported 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 automaketools

dnf install automake
  1. 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
  1. 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
  1. The error message is as follows
checking whether make sets $(MAKE)... no

Solution: missingmake

dnf install make
  1. The error message is as follows
checking for pyflakes... no
configure: WARNING: pyflakes not found

Solution:

pip3 install pyflakes

Running problem

  1. The error message is as follows
ModuleNotFoundError: No module named 'cherrypy'

Solution:

pip3 install cherrypy
  1. 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
  1. 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
  1. The error message is as follows
ModuleNotFoundError: No module named 'Cheetah'

Solution:

pip3 install Cheetah3
  1. The error message is as follows
ModuleNotFoundError: No module named 'lxml'

Solution:

pip3 install lxml
  1. The error message is as follows
ModuleNotFoundError: No module named 'psutil'

Solution:

pip3 install psutil
  1. The error message is as follows
ModuleNotFoundError: No module named 'websockify'

Solution: 注意: kimchiuse the latest version websockifythere is a problem

pip3 install websockify==0.7.0
  1. The error message is as follows
ModuleNotFoundError: No module named 'jsonschema'

Solution:

pip3 install jsonschema
  1. 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

  1. 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.logcommand 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”

Guess you like

Origin blog.csdn.net/macaiyun0629/article/details/109211522