服务器部署

67 阅读1分钟

一.最复杂版

购买服务器后,通过windterm来使用。 进入nginx网站找稳定版本。 nginx.org/en/download…

image.png

image.png

cd nginx-1.26.2
/configure

会爆如下错误

image.png

yum install pcre pcre-devel -y

OpenSSL:以后配置https需要。 image.png

yum install openssl openssl-devel -y

./configure --with-http_ssl_module --with-http_v2_module --with-stream

编译成二进制可执行文件

make
make install 

image.png

/usr/local/nginx/sbin/nginx

查看可执行文件

image.png

    ls
    free -h
    yum
    clear
    mkdir services
    ls
    cd services/
    curl -o nginx-1.26.2.tar.gz https://nginx.org/download/nginx-1.26.2.tar.gz
    ls
    tar -zxvf nginx-1.26.2.tar.gz 
    ll -ah
    cd nginx-1.26.2
    ls
    ./configure
    yum install pcre pcre-devel -y
    ./configure
     yum install openssl openssl-devel -y
    ./configure
    ./configure --with-http_ssl_module --with-http_v2_module --with-stream
    make
    make install
    ls
    cd src/
    cd ..
    ls /usr/local/nginx/sbin/nginx
    nginx
    vim /etc/profile

image.png

    nginx
    vim /etc/profile
    source /etc/profile
    nginx
    netstat -ntlp
    cd conf
    ls
    cp nginx.conf nginx.default.conf
    cat nginx.conf
    ls
    pwd
    cd ..
    cd ..
    ls
    rz
    ls
    unzip dist.zip -d project
    cd project/
    ls
    cd dist/
    mv * ../
    cd ..
    ls
    cd ..
    ls
    cd nginx-1.26.2
    ls
    cd conf
    ls
    vim nginx.conf
    nginx -s reload
    vim nginx.conf
    //二进制文件在/usr/local/nginx目录下
    cp nginx.conf /usr/local/nginx
    cd /usr/local/nginx
    ls
    mv nginx.conf ./conf/
    cd conf
    ls
    cat nginx.conf
    nginx -s reload
    netstat -ntlp
    ps -ef|grep 'nginx'
    vim nginx.conf
    nginx -s reload
    history

配置java,maven /etc/profile 文件最后

export PATH=$PATH:/usr/local/nginx/sbin:/root/services/apache-maven-3.9.9/bin
   
    09:21:53 yum install -y java-1.8.0-openjdk*
    09:24:49 cd /root/services
    curl -o apache-maven-3.9.9-bin.tar.gz  https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
    09:26:09 tar -zxvf apache-maven-3.9.9-bin.tar.gz
    09:26:24 cd apache-maven-3.9.9
    09:26:30 cd bin
    09:26:31 ls
    09:26:42 pwd
    09:26:57 vim /etc/profile
    09:27:10 source /etc/profile
    09:27:23 mvn -v