阿里雲伺服器搭建lnmp 新手!!!!!

2021-10-03 17:57:13 字數 2393 閱讀 5671

今年,因為疫情原因,作為一名大學生的小遍也不得不宅在家裡,玩著電腦,無意間發現阿里雲有免費送6個月的伺服器,我也是趕忙去白嫖了下,不得不說真香!!!嫖完伺服器,我也是著手就嘗試了搭建lnmp。。。

安裝nginx

yum -y install nginx
(這一步沒有遇到什麼坑,也是很快就完成了!)

啟動nginx

service nginx start
設定nginx伺服器開機自啟動

systemctl enable nginx service
檢查開機自啟動裝置是否設定成功

systemctl list -dependencies | grep nginx
安裝php

.tar.gz進入目錄,編譯

cd php-

7.4.3

$ .

/configure --prefix=

/usr/local/php --with-config-file-path=

/usr/local/php --enable-mbstring --with-openssl --enable-ftp --with-gd --with-jpeg-dir=

/usr --with-png-dir=

/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pear --enable-sockets --with-freetype-dir=

/usr --with-zlib --with-libxml-dir=

/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=

/usr/lib/

--enable-soap --enable-pcntl --enable-cli --with-curl

(到這問題就開始來了!!!!!)

問題缺少sqlite包

yum -y install sqlite sqlite-devel(這個比較簡單)

缺少oniguruma

這個實在是折騰不出來了(可能是因為centos8的原因),一直顯示缺少這個包,折騰不下。。。最後就谷歌**好,不得不說,谷歌真厲害。

谷歌上搜到這個方法安裝oniguruma:

(獲取原始碼,解壓)

6.9.4(編譯安裝)

.

/autogen.sh &&

./configure --prefix=

/usr

make && make install

systemctl php-fpm start
安裝mysql8

終於到最後一步了!!!

這一步小遍沒碰到什麼坑,直接是看著別人的部落格就操作下來

參考部落格:

阿里雲伺服器搭建

1.購買伺服器後使用遠端連線 可以使用阿里雲網頁自帶的遠端連線,進行連線 進入介面輸入sudo su root切換成root模式進行操作 也可以使用其他互動軟體進行連線,如putty 阿里雲的操作例項 2.安裝lnmp 進入 複製安裝指令貼上到遠端連線內開始安裝 wget co lnmp1.6.ta...

阿里雲伺服器如何搭建LAMP環境(新手教程)

lamp指的是linux作業系統 apachehttp伺服器 mysql資料庫和php開源軟體。這裡我們可以通過執行下方yum源命令來完成安裝lamp yum install y httpd php php fpm php server php mysql mysqlwget c解壓wordpres...

阿里雲伺服器搭建 nginx服務

1.安裝nginx軟體所需依賴包 yum install y gcc gcc c autoconf pcre pcre devel make automake wget httpd tools2.配置nginx官方 yum源 root web vim etc yum.repos.d nginx.re...