安裝包:
nginx-1.13.7.tar.gz openssl-1.1.0g.tar.gz pcre-8.41.tar.gz zlib-1.2.11.tar.gz 新建檔案夾:nginx 注:我沒有新建nginx的時候,運行make命令的時候,報了如下error,新建nginx后沒有報錯
將安裝包全部解壓到nginx目錄下
cd nginx-1.13.7
sudo ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_addition_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --with-stream --with-pcre=/home/qinghuan/share/nginx/pcre-8.41 --with-zlib=/home/qinghuan/share/nginx/zlib-1.2.11 --with-openssl=/home/qinghuan/share/nginx/openssl-1.1.0g
注:紅色部分為自己的路徑
sudo make
sudo make install
執行到make時,報錯:WARNING:'aclocal-1.15' is missing on your system.
解決方法:
http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
./configure --docdir=/usr/share/doc/automake-1.15
sudo make
sudo make install
執行命令./configure后,報錯:Autoconf 2.65 or better is required
解決方法:
wget -O m4-1.4.9.tar.gz http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
tar -zvxf m4-1.4.9.tar.gz
cd m4-1.4.9
./configure
sudo make
sudo make install
此時沒有報錯了,再依次倒序安裝上面的安裝包,
安裝完畢后,在/usr/local下有nginx目錄,進入nginx目錄
執行:sudo ./sbin/nginx -c ./conf/nginx.conf
在本地物理機的瀏覽器中輸入ip地址,有如下顯示:
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/40739.html
標籤:Linux
上一篇:安裝office解決辦法
