完整步骤部署,包含中间遇到的错误和解决方式
可直接完全按照步骤来,获取的压缩包在/data/soft下
[root@localhost ~]# docker pull centos:7
[root@localhost ~]# docker run -i -t centos:7 /bin/bash
[root@1b8c1a72f834 /]# mkdir /data/{server,soft} -p
[root@1b8c1a72f834 /]# cd /data/soft
[root@1b8c1a72f834 soft]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
bash: wget: command not found
[root@1b8c1a72f834 soft]# yum -y install wget
[root@1b8c1a72f834 soft]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
[root@1b8c1a72f834 soft]# tar zxvf pcre-8.35.tar.gz
[root@1b8c1a72f834 soft]# cd pcre-8.35
[root@1b8c1a72f834 pcre-8.35]# ./configure
configure: error: in `/data/soft/pcre-8.35':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
[root@1b8c1a72f834 pcre-8.35]# yum install -y gcc-c++
[root@1b8c1a72f834 pcre-8.35]# ./configure
[root@1b8c1a72f834 pcre-8.35]# make && make install
bash: make: command not found
[root@1b8c1a72f834 pcre-8.35]# yum -y install gcc automake autoconf libtool make
[root@1b8c1a72f834 pcre-8.35]# pcre-config --version
8.35
[root@1b8c1a72f834 pcre-8.35]# cd ..
[root@1b8c1a72f834 soft]# cd ..
[root@1b8c1a72f834 data]# cd ..
[root@1b8c1a72f834 /]# useradd www -s /sbin/nologin -M
[root@1b8c1a72f834 /]# cd /data/soft/
[root@1b8c1a72f834 soft]# wget -c https://nginx.org/download/nginx-1.20.0.tar.gz
[root@1b8c1a72f834 soft]# tar xzf nginx-1.20.0.tar.gz
[root@1b8c1a72f834 soft]# cd nginx-1.20.0
[root@1b8c1a72f834 nginx-1.20.0]# ./configure --prefix=/data/server/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/data/soft/pcre-8.35
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
[root@1b8c1a72f834 nginx-1.20.0]# yum -y install openssl openssl-devel
[root@1b8c1a72f834 nginx-1.20.0]# make
[root@1b8c1a72f834 nginx-1.20.0]# make install
[root@1b8c1a72f834 nginx-1.20.0]# gedit /data/server/nginx/conf/nginx.conf
bash: gedit: command not found
[root@1b8c1a72f834 nginx-1.20.0]# yum -y install gedit
gedit问题:新开终端
[root@localhost ww958]# docker cp 1b8c1a72f834:/data/server/nginx/conf/nginx.conf /home/ww958/桌面
[root@localhost ww958]# cd /home/ww/桌面
[root@localhost 桌面]# ls
navicat112_mysql_cs_x64 nginx.conf
navicat112_mysql_cs_x64.tar.gz ZenTaoPMS.8.2.5.zip
[root@localhost 桌面]# gedit nginx.conf
[root@localhost 桌面]# docker cp /home/ww/桌面/nginx.conf 1b8c1a72f834:/data/server/nginx/conf/
[root@1b8c1a72f834 nginx-1.20.0]# /data/server/nginx/sbin/nginx
[root@1b8c1a72f834 nginx-1.20.0]# netstat -tnulp | grep nginx
bash: netstat: command not found
[root@1b8c1a72f834 nginx-1.20.0]# yum install net-tools
[root@1b8c1a72f834 nginx-1.20.0]# netstat -tnulp | grep nginx
[root@1b8c1a72f834 nginx-1.20.0]# cd ~
[root@1b8c1a72f834 ~]# cd /
错误解决
问题1:bash: wget: command not found,找不到wget命令
解决方法:yum -y install wget
问题2:configure: error: in /data/soft/pcre-8.35': configure: error: no acceptable C compiler found in $PATH Seeconfig.log’ for more details
解决方法:yum install -y gcc-c++
问题3:bash: make: command not found,找不make到命令
解决方法:um -y install gcc automake autoconf libtool make
问题4:./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=
解决方法:yum -y install openssl openssl-devel
问题5:bash: gedit: command not found,找不到gedit命令
解决方法:yum -y install gedit
问题6:bash: netstat: command not found,找不到netstat命令
解决方法:yum install net-tools