內部使用環(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();
?>
從此告別搭建儀式....... 開啟新的篇章
