centos 6.5 使用yum 快速搭建lnmp 環(huán)境

內部使用環(huán)境,就懶得用 源碼搭建了

? ? ?閑扯淡... ? ?直接搞代碼

安裝 nginx 需要搞一個能使用的源地址,默認的,aliyun 的地址都不能直接用來安裝nginx 只能上網搞一個,索性留下了一個能用的

[root@XY-0-119-linux yum.repos.d]# cat atomic.repo

# Name: Atomic Rocket Turtle RPM Repository for CentOS / Red Hat Enterprise Linux 6 -

[atomic]

name = CentOS / Red Hat Enterprise Linux $releasever - atomic

mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic/centos-$releasever-$basearch

enabled = 1

protect = 0

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt

file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt

# Almost Stable, release candidates for [atomic]

[atomic-testing]

name = CentOS / Red Hat Enterprise Linux $releasever - atomic - (Testing)

mirrorlist = http://updates.atomicorp.com/channels/mirrorlist/atomic-testing/centos-$releasever-$basearch

enabled = 0

protect = 0

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt

file:///etc/pki/rpm-gpg/RPM-GPG-KEY.atomicorp.txt

gpgcheck = 1


或者一條命令 搞定

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

還有一個只能安裝nginx的 索性也下,來者不拒

# nginx.repo

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/6/$basearch/

gpgcheck=0

enabled=1

搞定這個東西就可以瘋狂式安裝了


yum ?-y install nginx?

#安裝完成之后 啟動nginx

/etc/init.d/nginx? restart

可以愉快的使用 curl ?http://localhost ??

看到Welcome nginx 的字眼 ? 就說明安裝nginx 成功了


接下來安裝 mysql 數(shù)據(jù)庫

yum -y install mysql? mysql-server? mysql-devel

安裝完成mysql之后就可以直接啟動mysql數(shù)據(jù)庫

完成之后可以查看端口是否啟動

root@XY-0-45-root> netstat -atnpu | grep? 3306

tcp? ? ? ? 0? ? ? 0 0.0.0.0:3306? ? ? ? ? ? ? ? 0.0.0.0:*? ? ? ? ? ? ? ? ? LISTEN? ? ? 2085/mysqld

mysql到此結束。安裝完成

接下來安裝的比較多 php ? (世界上最好的語言...嘎嘎)

yum -y install php-cli php-soap php-mysql php-mssql php-pear php-gd php-tidy php-xmlrpc php-devel php ?php-pdo php-mcrypt php-snmp php-xml php-bcmath php-pecl php-common php-ldap php-imap php-odbc php-mbstring php-mhash

耐心的等待完成

啟動php程序

/etc/init.d/php-fpm? start

起來了之后 查看一下端口 9000

沒有問題之后 修改nginx配置文件?

location ~ \.php$ {

root? ? ? ? ? html;

fastcgi_pass? 127.0.0.1:9000;

fastcgi_index? index.php;

fastcgi_param? SCRIPT_FILENAME? /usr/share/nginx/html$fastcgi_script_name;

include? ? ? ? fastcgi_params;

}


OK?

開始測試php?

在/usr/share/nginx/html 目錄下面建立一個 index.php文件

<?php

phpinfo();

?>


從此告別搭建儀式....... 開啟新的篇章

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容