當前位置:首頁 » 操作系統 » centoslnmp源碼安裝

centoslnmp源碼安裝

發布時間: 2022-02-21 19:44:00

Ⅰ CentOS 7 用戶怎樣安裝 LNMP

Nginx不是從官方CentOS庫安裝,我們從 nginx 項目安裝庫安裝,修改源:
vi /etc/yum.repos.d/nginx.repo
修改為:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3 安裝 Mysql
我們先安裝MariaDB。一個免費的MySQL 分支。運行此命令:
yum install mariadb mariadb-server net-tools
然後我們創建MySQL系統啟動鏈接(所以MySQL的自動啟動時,系統啟動)啟動MySQL伺服器:
systemctl enable mariadb.service
systemctl start mariadb.service
現在檢查網路啟用。運行
netstat -tap | grep mysql
它應該顯示出這樣的內容:
[root@example ~]# netstat -tap | grep mysql
tcp 0 0 0.0.0.0:mysql 0.0.0.0:* LISTEN 10623/mysqld

Ⅱ CentOS 7 用戶怎樣安裝 LNMP

安裝方式有多種
一、源碼編譯安裝(一個軟體一個軟體編譯,其實編譯的過程都差不多,只要會一個,其它軟體都一樣,只不過參數修改一下)

二、rpm 包安裝,比第一個方法簡單些

三、yum安裝,很簡單 yun install 軟體名

四、看你問這個問題,感覺像初次接觸 linux 下開發,我建議初次接觸的安裝集成環境,快、簡,比如:安裝 wdcp ,在 網路搜 WDCP ,到官網,從下載到安裝就幾行命令,而且說的很詳細

Ⅲ CentOS 7 用戶怎樣安裝 LNMP

LNMP是一個基於CentOS編寫的Nginx、php、MySQL、phpMyAdmin、eAccelerator一鍵安裝包。可以在獨立主機上輕松的安裝LNMP生產環境。 一、獲取lnmp源碼 1、打開網路,輸入lnmp,打開第一個lnmp官網,裡面含有很豐富的信息,這里先下載最新版的安裝包 2、通過wget soft/lnmp/lnmp1.2-full.tar.gz 下載,選擇其他下載地址也可以的; 二、安裝lnmp 1、解壓tar -xvf lnmp1.2-full.tar.gz ; 2、進入 源碼目錄cd lnmp1.2-full/ 3、執行./install.sh開始配置,配置完提示Press any key to install...or Press Ctrl+c to cancel,回車後自動編譯安裝,過程比較漫長,好好等待; 4、安裝完成,雖然等待了很久。但是安裝完成了很開心。 三、lnmp基本操作 1、開啟關閉lnmp服務; 2、訪問主要,phpinfo等,驗證是否安裝成功; 3、在web根目錄下編寫腳本訪問,通過瀏覽器訪問; 訪問輸出,腳本信息,這樣就安裝成功了。 注意事項: 下載和安裝過程比較漫長,一定耐心仔細

Ⅳ centos6.5 lnmp安裝怎樣判斷是否成功

直接訪問ip 看下能不能訪問

Ⅳ CentOS 7 用戶怎樣安裝 LNMP

LNMP是一個基於CentOS編寫的Nginx、PHP、MySQL、phpMyAdmin、eAccelerator一鍵安裝包。可以在獨立主機上輕松的安裝LNMP生產環境。
一、獲取lnmp源碼
1、打開網路,輸入lnmp,打開第一個lnmp官網,裡面含有很豐富的信息,這里先下載最新版的安裝包
2、通過wget http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz 下載,選擇其他下載地址也可以的;

二、安裝lnmp
1、解壓tar -xvf lnmp1.2-full.tar.gz ;
2、進入 源碼目錄cd lnmp1.2-full/
3、執行./install.sh開始配置,配置完提示Press any key to install...or Press Ctrl+c to cancel,回車後自動編譯安裝,過程比較漫長,好好等待;
4、安裝完成,雖然等待了很久。但是安裝完成了很開心。

三、lnmp基本操作
1、開啟關閉lnmp服務;
2、訪問主要,phpinfo等,驗證是否安裝成功;
3、在web根目錄下編寫腳本訪問,通過瀏覽器訪問;
訪問輸出,腳本信息,這樣就安裝成功了。

注意事項:
下載和安裝過程比較漫長,一定耐心仔細

Ⅵ 如何在centos7上部署lnmp環境

一、安裝httpd。
yum install -y httpd
安裝完成之後使用以下命令啟動httpd服務:
systemctl start httpd.service #啟動apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重啟apache
systemctl enable httpd.service #設置apache開機啟動 可以在瀏覽器中輸入伺服器所在的主機的IP即可看到apache的歡迎界面。要在另外一台主機上實現這種訪問,需要關閉系統的防火牆。 在CentOS7中,修改防火牆的機制已經做了修改,在CentOS 6.x系統中可以使用以下命令:
service iptables stop
chkconfig iptables off // 開機禁止啟動
而在CentOS7中只能使用以下命令,如果使用上面的命令並不會報任何錯誤,但是起不到關閉防火牆的效果:
systemctl stop firewalld.service
systemctl disable firewalld.service //禁止防火牆開機啟動關閉SeLinux:
使用getenforce命令可以查看SeLinux的狀態,SeLinux有三種狀態,分別為enforcing、permissive和disabled。因為我們的伺服器只在內部使用,所以這里我們選擇完全關閉(disabled)。具體的做法為修改/etc/sysconfig/selinux文件,具體操作可以看裡面的說明。
成功安裝httpd(apache)的效果圖為:
二、安裝MySQL資料庫
MySQL資料庫,新版本已經更名為Mariadb,所以這里需要安裝Mariadb,可以使用下面的命令進行安裝:
yum install -y mariadb
安裝完成以後使用下面的命令開啟資料庫服務:
systemctl start mariadb.service #啟動MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重啟MariaDB
systemctl enable mariadb.service #設置開機啟動
三、安裝PHP。
使用下面的命令可以安裝PHP:
yum -y install php
使用下面的命令安裝php對Mariadb的支持:
yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
使用下面的命令重啟Mariadb和httpd服務:
systemctl restart mariadb.service #重啟MariaDB
systemctl restart httpd.service #重啟apache

Ⅶ CentOS 7 用戶怎樣安裝 LNMP

1 先說一下
本文使用的主機名稱: server1.example.com 和IP地址: 192.168.1.105。這些可能與你的計算機有所不同,注意進行修改。
2 使用外部倉庫
Nginx不是從官方CentOS庫安裝,我們從 nginx 項目安裝庫安裝,修改源:
vi /etc/yum.repos.d/nginx.repo
修改為:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3 安裝 MySQL
我們先安裝MariaDB。一個免費的MySQL 分支。運行此命令:
yum install mariadb mariadb-server net-tools
然後我們創建MySQL系統啟動鏈接(所以MySQL的自動啟動時,系統啟動)啟動MySQL伺服器:
systemctl enable mariadb.service
systemctl start mariadb.service
現在檢查網路啟用。運行
netstat -tap | grep mysql
它應該顯示出這樣的內容:
[root@example ~]# netstat -tap | grep mysql
tcp 0 0 0.0.0.0:mysql 0.0.0.0:* LISTEN 10623/mysqld

運行
mysql_secure_installation
為用戶設置根口令(否則,任何人都可以訪問你的MySQL資料庫!):
[root@example ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we』ll need the current
password for the root user. If you』ve just installed MariaDB, and
you haven』t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] <– 回車
New password: <– 輸入ROOT密碼
Re-enter new password: <– 再輸入一次ROOT密碼
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
proction environment.
Remove anonymous users? [Y/n] <– 回車
… Success!
Normally, root should only be allowed to connect from 『localhost』. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <– 回車
… Success!
By default, MariaDB comes with a database named 『test』 that anyone can
access. This is also intended only for testing, and should be removed
before moving into a proction environment.
Remove test database and access to it? [Y/n] <– 回車
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <– 回車
… Success!
Cleaning up…
All done! If you』ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
[root@example ~]#
[root@server1 ~]# mysql_secure_installation

4 安裝 Nginx
Nginx可以作為一個包從nginx.org安裝,運行:
yum install nginx
然後我們創建的系統啟動nginx的鏈接和啟動它:
systemctl enable nginx.service
systemctl start nginx.service
有時,你會得到一個錯誤,如80埠已在使用中,錯誤消息會是這樣的
[root@server1 ~]# service nginx start
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
[root@server1 ~]#
這就意味著有時在運行Apache服務。停止服務,進一步啟動服務nginx如下
systemctl stop httpd.service
yum remove httpd
systemctl disable httpd.service
systemctl enable nginx.service
systemctl start nginx.service
開放的HTTP和HTTPS防火牆中的埠
firewall-cmd –permanent –zone=public –add-service=http
firewall-cmd –permanent –zone=public –add-service=https
firewall-cmd –reload
輸出的shell結果將看起來像這樣:
[root@example ~]# firewall-cmd –permanent –zone=public –add-service=http
success
[root@example ~]# firewall-cmd –permanent –zone=public –add-service=https
success
[root@example ~]# firewall-cmd –reload
success
[root@example ~]#
在你的Web伺服器的IP地址或主機名稱輸入到瀏覽器(如HTTP:/ /192.168.1.105),你應該看到nginx的歡迎頁面。
5 安裝 PHP5
我們可以通過PHP-FPM使nginx的PHP5工作(PHP-FPM(FastCGI進程管理器)是一種替代PHP FastCGI執行一些額外的功能,支持任何規模大小,尤其是繁忙的站點很有用)。我們可以安裝php-fpmtogether用PHP-CLI和一些PHP5的模塊,如PHP,MySQL,你需要的,如果你想使用MySQL的PHP命令如下:
yum install php-fpm php-cli php-mysql php-gd php-ldap php-odbc php-pdo php-pecl-memcache php-pear php-mbstring php-xml php-xmlrpc php-mbstring php-snmp php-soap
APC是一個自由和開放的PHP操作碼來緩存和優化PHP的中間代碼。它類似於其他PHP操作碼cachers,如eAccelerator和XCache。強烈建議有���些安裝,以加快您的PHP頁面。
我會從PHP PECL庫中安裝的APC。 PECL要求CentOS開發工具beinstalled編譯APC包。
yum install php-devel
yum groupinstall 『Development Tools』
安裝 APC
pecl install apc
[root@example ~]# pecl install apc
downloading APC-3.1.13.tgz …
Starting to download APC-3.1.13.tgz (171,591 bytes)
……………..done: 171,591 bytes
55 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Mole Api No: 20100525
Zend Extension Api No: 220100525
Enable internal debugging in APC [no] : <– 回車
Enable per request file info about files used from the APC cache [no] : <– 回車
Enable spin locks (EXPERIMENTAL) [no] : <– 回車
Enable memory protection (EXPERIMENTAL) [no] : <– 回車
Enable pthread mutexes (default) [no] : <–回車
Enable pthread read/write locks (EXPERIMENTAL) [yes] : <– 回車
building in /var/tmp/pear-build-rootVrjsuq/APC-3.1.13
……
然後打開 /etc/php.ini 並設置 cgi.fix_pathinfo=0:
vi /etc/php.ini
[...]
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
cgi.fix_pathinfo=0
[...]

並添加行:
[...]
extension=apc.so

在 /etc/php.ini 文件後面。
除此之外,為了避免這樣的時區的錯誤:
[21-July-2014 10:07:08] PHP Warning: phpinfo(): It is not safe to rely on the system』s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 『Europe/Berlin』 for 『CEST/2.0/DST』 instead in /usr/share/nginx/html/info.php on line 2
… in /var/log/php-fpm/www-error.log 當你在瀏覽器中調用一個PHP腳本,你應該設置 date.timezone in /etc/php.ini:
[...]
[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "Europe/Berlin"
[...]

您可以通過運行正確的時區支持您的系統:
cat /etc/sysconfig/clock
[root@server1 nginx]# cat /etc/sysconfig/clock
ZONE=」Europe/Berlin」
[root@server1 nginx]#
接下來,創建系統啟動鏈接的PHP-FPM並啟動它:
systemctl enable php-fpm.service
systemctl start php-fpm.service
PHP-FPM是一個守護進程(使用init腳本/etc/init.d/php-fpm) 運行在埠9000的FastCGI伺服器。

Ⅷ CentOS 7 用戶怎樣安裝 LNMP

您可以選擇使用下載版(推薦國外或者美國VPS使用)或者完整版(推薦國內VPS使用),兩者沒什麼區別,只是完整版把一些需要的源碼文件預先放到安裝包里。
安裝LNMP執行:

wget -c http://soft.vpser.net/lnmp/lnmp1.3-full.tar.gz && tar zxf lnmp1.3-full.tar.gz && cd lnmp1.3-full && ./install.shlnmp

默認安裝lnmp可不寫,如需要安裝LNMPA或LAMP,將./install.sh 後面的參數替換為lnmpa或lamp即可。
如下載速度慢請更換其他下載節點,詳情請看下載頁面。LNMP下載節點具體替換方法。
按上述命令執行後,會出現如下提示:
需要設置MySQL的root密碼(不輸入直接回車將會設置為root)如果輸入有錯誤需要刪除時,可以按住Ctrl再按Backspace鍵進行刪除。輸入後回車進入下一步,如下圖所示:
問是否需要啟用MySQL InnoDB,InnoDB引擎默認為開啟,一般建議開啟,直接回車或輸入 y ,如果確定確實不需要該引擎可以輸入 n,輸入完成,回車進入下一步
選擇MySQL版本,目前提供了較多版本的MySQL和MariaDB,需要注意的是MySQL 5.6,5.7及MariaDB 10必須在1G以上內存的更高配置上才能選擇:
輸入對應MySQL或MariaDB版本前面的序號,回車進入下一步,選擇PHP版本:
注意:選擇PHP7等高版本時需要自行確認是否與自己的程序兼容。
輸入要選擇的PHP版本的序號,回車進入下一步,選擇是否安裝內存優化:
可以選擇不安裝、Jemalloc或TCmalloc,輸入對應序號回車,直接回車為默認為不安裝。
如果是LNMPA或LAMP的話還會提示「Please enter Administrator Email Address:」,需要設置管理員郵箱,該郵箱會在報錯時顯示在錯誤頁面上。
再選擇Apache版本
按提示輸入對應版本前面的數字序號,回車。
提示"Press any key to install...or Press Ctrl+c to cancel"後,按回車鍵確認開始安裝。
LNMP腳本就會自動安裝編譯Nginx、MySQL、PHP、phpMyAdmin、Zend Optimizer這幾個軟體。
安裝時間可能會幾十分鍾到幾個小時不等,主要是機器的配置網速等原因會造成影響。

熱點內容
android彈出布局 發布:2024-09-20 19:14:29 瀏覽:981
預演算法包括 發布:2024-09-20 18:52:07 瀏覽:764
什麼數字後面跟著密碼 發布:2024-09-20 18:52:07 瀏覽:878
訂座源碼 發布:2024-09-20 18:52:06 瀏覽:383
手機mud源碼 發布:2024-09-20 18:51:28 瀏覽:940
3k我的使命腳本 發布:2024-09-20 18:11:43 瀏覽:691
建設銀行密碼怎麼設置 發布:2024-09-20 18:11:04 瀏覽:96
聚合腳本平台 發布:2024-09-20 17:51:55 瀏覽:182
訪問攔截怎麼解除安卓 發布:2024-09-20 17:28:48 瀏覽:277
蘿卜干存儲 發布:2024-09-20 17:21:37 瀏覽:719