[Operação e manutenção] Instalar e implantar o wok no sistema CentOS8

Descrição do ambiente do sistema

Sistema: CentOS-8.2.2004
Plataforma:x86-64

Ferramentas usadas para instalar

  1. gitinstalação
dnf install git

download de software

Compilar e instalar, aquisição de código-fonte

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

A githubvelocidade de check-out do código-fonte é relativamente lenta. Você pode usar a aceleração de espelho doméstico. Para métodos de aceleração de espelho doméstico, consulte Github Aceleração de espelho doméstico . Para espelhamento acelerado, consulte GitHub acelerado espelhamento.

Instalação dependente

Compilar instalação dependente

wokNecessidade de compilação automake, gcc, makee outros dependentes

dnf install automake gcc make
pip3 install pyflakes

Executar instalação de dependência

dnf install python36-devel openldap-devel nginx
pip3 install cherrypy python-ldap python-pam Cheetah3 lxml psutil jsonschema
pip3 install websockify==0.7.0

wokinstalação

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

Configuraçãowok

  1. Desligue o SELinux
# 永久关闭/启动:修改/etc/sysconfig/selinux后重启系统
vim /etc/sysconfig/selinux # 将“SELINUX=enforcing“改成“SELINUX=desabled”
  1. O firewall permite a porta de acesso e o wok usa por padrão a porta 8001. Para operações comuns de firewall, consulte operações comuns do firewall centos8
firewall-cmd --add-port=8001/tcp --permanent 
firewall-cmd --reload
  1. Configurar inicialização
systemctl enable wokd

Habilitar depuração do modo de desenvolvimento

python3 /bin/wokd --environment=dev

wokInstalação de plug-in

  1. kimchiInstalação, consulte instalação e implantação de kimchi no CentOS8

problema comum

Problema de compilação

  1. A execução ./autogen.sh --systemrelatou o seguinte erro
./autogen.sh: line 23: aclocal: command not found
./autogen.sh: line 24: automake: command not found
./autogen.sh: line 25: autoreconf: command not found

Solução: automakeferramentas ausentes

dnf install automake
  1. A mensagem de erro é a seguinte
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH

Solução: ausentegcc

dnf install gcc
  1. A mensagem de erro é a seguinte
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'

Solução:

automake --add-missing
  1. A mensagem de erro é a seguinte
checking whether make sets $(MAKE)... no

Solução: faltandomake

dnf install make
  1. A mensagem de erro é a seguinte
checking for pyflakes... no
configure: WARNING: pyflakes not found

Solução:

pip3 install pyflakes

Problema de funcionamento

  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'cherrypy'

Solução:

pip3 install cherrypy
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'ldap'

Solução: ocorreu um erro durante o processo de instalação, consulte o tratamento de erros comuns do python [sistema CentOS8] (aplicativo de instalação pip)

pip3 install python-ldap
  1. A mensagem de erro é a seguinte
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'

Solução:

pip3 install python-pam
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'Cheetah'

Solução:

pip3 install Cheetah3
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'lxml'

Solução:

pip3 install lxml
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'psutil'

Solução:

pip3 install psutil
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'websockify'

Solução: 注意: kimchiusar a versão mais recente websockifyhá um problema

pip3 install websockify==0.7.0
  1. A mensagem de erro é a seguinte
ModuleNotFoundError: No module named 'jsonschema'

Solução:

pip3 install jsonschema
  1. A mensagem de erro é a seguinte
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.

Solução:

dnf install nginx

Problema de configuração

  1. A mensagem de erro é a seguinte
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

Após a execução systemctl status nginx.service, a mensagem de erro é exibida da seguinte forma

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 o tail -100f /var/log/nginx/error.logcomando para visualizar as informações de erro do log, as informações de erro são exibidas da seguinte forma

63706#0: bind() to 0.0.0.0:8001 failed (13: Permission denied)

Solução: A causa do problema é que o SELinux intercepta as solicitações do Nginx por padrão com base no princípio do menor privilégio, que pode ser resolvido desligando o SELinux

# 临时关闭 SELinux
setenforce 0
# 临时启动 
SELinux:setenforce 1
# 永久关闭/启动:修改/etc/sysconfig/selinux后重启系统
vim /etc/sysconfig/selinux # 将“SELINUX=enforcing“改成“SELINUX=desabled”

Acho que você gosta

Origin blog.csdn.net/macaiyun0629/article/details/109211522
Recomendado
Clasificación