最近感覺好久沒有接觸lnmp開發環境搭建,配置等等,導致有時候用的時候會記不起來,所以單獨配置配置環境,練習下
我最先嘗試用apt-get install nginx 安裝,但是出現了很奇怪的錯誤,導致apt-get remove nginx 也失敗,最後通過
find / -name '*nginx*' | xargs rm -rf
把nginx 的檔案全部刪除啦,但是重新安轉還是失敗,暫時放棄apt-get 的安裝方式,而採用源碼方式
su
cd /usr/local/src ://nginx.org/download/nginx-1.9.6.tar.gz
tar -zxvf nginx-1.9.6.tar.gz
nginx-1.9.6x-1.9.6 configure --prefix=/usr/local/nginx
make
make loll
ln -s /usr/loll
ln啟動的時候出錯了
<code>Starting nginx: nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>) nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>) nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>) nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>) nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>) nginx: [emerg] still could <span>not</span> bind()</code>
sudo fuser -k 80/tcp
/etc/init.d/nginx
/etc/init.d/nginx stop
竟然又出錯啦,invalid stop, 很納悶,那怎麼來終止啦我直接用這個killall -9 nginx
搞定啦,啟動時候直接
/etc/init.d/nginx
killall -9 nginxhost 就ok,停止就瀏覽器80 搞定啦
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i
').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介紹了ubuntu 安裝 nginx一,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。