[翻译]一个让Nginx ,PHP-FPM,MariaDB 跑在CentOS上的简介

lnmpwithwordpress

 

这货是来自LEB的介绍。所以阿福仅仅只做翻译。当然前戏太长了。阿福只说一点点,那就是MariaDB这货是MySQL的替代品,说实话,当甲骨文收购sun的是MySQL就不在为那些技术们所推崇了,原作者再次搞出来一个叫MariaDB的玩意。好吧,其实阿福也不太熟悉这玩意。总之架构和MySQL差不多。

首先更新CentOS

yum update

然后,清楚不必要的组件如apache

yum erase httpd httpd-tools

然后安装nginx和php-fpm

yum install nginx php-fpm

找到下面的一段

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root           html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_index  index.php;
#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
#    include        fastcgi_params;
#}

修改为

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini

# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

 

下面安装MariaDB

先新建一个yum,vi /etc/yum.repos.d/MariaDB.repo

# MariaDB 5.5 CentOS repository list – created 2013-12-27 07:29 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

然后

yum install MariaDB-server MariaDB-client php-mysql

然后/etc/init.d/php-fpm restart

然后搞定~

作者: 阿福

购买时被坑爹的枪手坑了。只知道介绍如何如何的好,不知道介绍其坏处。因此,写此博客,望能给各大网友帮助。

发表评论

电子邮件地址不会被公开。 必填项已用*标注