LNMP一鍵安裝過程詳解
解壓縮一鍵安裝包
我們把 LNMP 一鍵安裝包保存在 /usr/local/src/ 目錄下,第一步仍然是解壓縮一鍵安裝包。命令如下:
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# tar -zxvf lnmp1.0-full.tar.gz
執行安裝腳本安裝 LNMP 一鍵安裝包
既然是腳本安裝包,那就不需要我們一個一個手工安裝了,只要執行安裝腳本 centos.sh 即可自動安裝(Debian 中執行腳本為 debian.sh,Ubuntu 中執行腳本為 ubuntu.sh)。命令如下:
[root@localhost src]# cd lnmp1.0-full
[root@localhost lnmp1.0-full]#./centos.sh
==========================================================
LUMP V1.0 for CentOS/RadHat Linux VPS Written by Licess
==========================================================
A tool to auto-compile & install Nginx+mysql+PHP on Linux
For more information please visit http://www.lnmp.org/
==========================================================
Please input the root password of mysql:
(Default password: root) : 123 #設定MySQL 的密碼,這里設為 123
==========================================================
Do you want to install the InnoDB Storage Engine?
(Default no,if you want please input: y , if not please press the enter button):y
#是否需要安裝MySQL InnoDB,如果需要安裝則輸入y
Install PHP 5.3.17,Please input y
Install PHP 5.2.17,Please input n or press Enter
(Please input y or n) :y
#選擇安裝PHP的版本,輸入y安裝的是5.3.17
Install MySQL 5.5.27,Please input y
Install MySQL 5.1.60,Please input n or press Enter
(Please input y or n) :y
#選擇安裝MySQL的版本,輸入y安裝的是5.5.27
Press any key to start. . .or Press Ctrl+c to cancel #按任意鍵開始安裝
具體的安裝時間要視 Linux 服務器的性能而定,可能會等待幾十分鐘。如果大家有興趣,則可以查看一下 centos.sh 這個安裝腳本,看看它是如何實現自動安裝的。如果看到以下界面,則證明安裝成功。
=========================================================
Manager for LNMP VI.0 , Written by Licess
=========================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org
Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================
Nginx is runing!
php-fpm is runing!
MySQL running (12489) [確定]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:53575 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::57454 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:631 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
LNMP一鍵安裝包安裝的軟件及具體位置
既然是一鍵安裝,那么默認安裝的軟件和軟件的安裝位置都是事先設定好的,在安裝過程中不能更改。具體安裝了哪些軟件及其位置如表 1 所示。默認安裝軟件 | 軟件安裝位置 | 軟件相關配置文件名 | 配置文件安裝位置 |
---|---|---|---|
Nginx | /usr/local/nginx/ | Nginx 配置文件 | /usr/local/nginx/conf/nginx.conf |
默認網站目錄 | /home/wwwroot/delault | ||
曰志文件 | /home/wwwlogs/ | ||
MySQL | /usr/local/mysql/ | MySQL 配置文件 | /etc/my.cnf |
數據所在位置 | /usr/local/mysql/var/ | ||
PHP | /usr/local/php/ | PHP 配置文件 | /usr/local/php/etc/php.ini |
php-fpm配置文件 | /usr/local/php/clc/php-rpm.conf | ||
phpMyAdmin | /homc/wwwroot/dcfault/phpmyadmin/ | 無 | 無 |
Zend Optimizer | /usr/local/zend/ | 無 | 無 |
也就是說,LNMP 一鍵安裝只安裝了基本的 Nginx、MySQL、PHP、phpMyAdmin 和 Zend Optimizer。
beylze編程學院,一個分享編程知識和seo優化知識的網站。跟著beylze一起學習,每天都有進步。
通俗易懂,深入淺出,一篇文章只講一個知識點。
文章不深奧,不需要鉆研,在公交、在地鐵、在廁所都可以閱讀,隨時隨地漲姿勢。
文章不涉及代碼,不燒腦細胞,人人都可以學習。
當你決定關注beylze(公眾號:beylze),你已然超越了90%的其他從業者!