阿里雲nginx安裝

1.登陸Linux服務器
            ssh root@ip 
            輸入密碼html

2.安裝依賴
            yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-develnginx

3.建立一個文件夾
            cd /usr/local
            mkdir nginx
            cd nginxtomcat

4.    下載tar包
            wget http://nginx.org/download/nginx-1.13.7.tar.gz
            沒有wget命令
                    yum安裝
                    yum -y install wgetbash

5.    解壓文件:
                tar -xvf nginx-1.13.7.tar.g
            進入文件夾  cd  nginx-1.13.7服務器

6.    執行命令,進行加載其餘配置文件
            ./configure
            make
            make installssh

7.啓動
            進入安裝目錄:/usr/local/nginx
            sbin目錄下
                執行啓動;./nginx 
                執行重啓:./nginx -s reloadcurl

查看是否啓動:curl 127.0.0.1:80
                報錯:-bash: curl: command not found 
                進行雲安裝:    yum install curl
                默認配置文件路徑:/conf 目錄下的nginx.conf
        
        8. 配置nginx服務器指向tomcat服務器地址:
            location / {
                root html;
                index index.html index.htm;
                proxy_pass http://localhost:8080;
            }url

相關文章
相關標籤/搜索