国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Ubuntu > 正文

Ubuntu 搭建LNMP環境圖文教程 安裝Nginx服務器

2020-10-18 20:54:11
字體:
來源:轉載
供稿:網友

跟MySQL安裝一樣,先進入“/usr/local/src”中,鍵入“cd /usr/local/src”回車,進入到文件夾中,接著鍵入“sudo wget http://nginx.org/download/nginx-0.8.37.tar.gz”回車,等待下載完畢。
下載完畢后,執行“sudo tar zxvf nginx-0.8.37.tar.gz”回車解壓文件。

然后進入nginx源碼目錄,配置安裝操作。鍵入“cd nginx-0.8.37”回車,再執行“sudo ./configure --prefix=/usr/local/server/nginx --with-http_stub_status_module”。

配置完成后,開始編譯源碼包。鍵入“sudo make && make install”回車,等待操作結束。

將附件中的nginx.sh復制到/etc/init.d/nginx,鍵入“sudo cp nginx.sh /etc/init.d/nginx”回車,再執行“sudo chmod +x /etc/init.d/nginx”。

啟動nginx,執行“sudo /etc/init.d/nginx start”啟動服務器。

瀏覽器輸入“http://127.0.0.1”回車,顯示如下頁面,說明服務器成功啟動。

停止服務器輸入命令“sudo /etc/init.d/nginx stop”。

課程附件nginx.sh

復制代碼
代碼如下:

#!/bin/bash
#
# chkconfig: - 85 15
# description: Nginx is a World Wide Web server.
# processname: nginx
nginx=/usr/local/server/nginx/sbin/nginx
conf=/usr/local/server/nginx/conf/nginx.conf
case $1 in
start)
echo -n "Starting Nginx"
$nginx -c $conf
echo " done"
;;
stop)
echo -n "Stopping Nginx"
killall -9 nginx
echo " done"
;;
test)
$nginx -t -c $conf
;;
reload)
echo -n "Reloading Nginx"
ps auxww | grep nginx | grep master | awk '{print $2}' | xargs kill -HUP
echo " done"
;;
restart)
$0 stop
$0 start
;;
show)
ps -aux|grep nginx
;;
*)
echo -n "Usage: $0 {start|restart|reload|stop|test|show}"
;;
esac
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东海县| 长治县| 梅河口市| 恭城| 岫岩| 运城市| 法库县| 尼勒克县| 保山市| 瑞安市| 武乡县| 铜川市| 临安市| 台前县| 渝中区| 昭苏县| 吴忠市| 兰考县| 大洼县| 曲松县| 常德市| 电白县| 洛阳市| 洪雅县| 乌兰浩特市| 西藏| 霸州市| 宁南县| 建湖县| 乐昌市| 滦平县| 赤峰市| 慈利县| 晋宁县| 白水县| 曲麻莱县| 阜宁县| 云南省| 汽车| 都昌县| 江津市|