> 适用于 CentOS 6.5 x64
# Nginx
``` bash
yum install nginx
chkconfig nginx on
service nginx start
```
# MySQL 5.7
```bash
yum install mysql-community-server
chkconfig mysqld on
service mysqld start
```
``` bash
# 查看默认密码
grep 'temporary password' /var/log/mysqld.log
# 修改默认密码
mysqladmin -u root -p password 123456Tt@iKECIN
```
# PHP 7.1
``` bash
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum install yum-utils
```
``` bash
yum install php71
ln -s /usr/bin/php71 /usr/bin/php
```
``` bash
yum install php71-php-gd php71-php-mbstring php71-php-mcrypt php71-php-mysqlnd php71-php-opcache php71-php-pdo php71-php-pecl-apcu php71-php-pecl-zip php71-php-process php71-php-xml php71-php-pecl-xdebug
```
# PHP-FPM
``` bash
yum install php71-php-fpm
chkconfig php71-php-fpm on
```
修改 FPM 配置 `/etc/opt/remi/php71/php-fpm.d/www.conf`
``` ini
pm.status_path = /status
listen = 127.0.0.1:9999
pm.max_requests=500
request_terminate_timeout=600s
```
``` bash
service php71-php-fpm start
```
# Composer
```bash
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/bin/composer
```
设置composer国内镜像(**需要切换到非root用户**)
```base
#设置国内镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
```
# 其它修改
## 启用 apache 用户
> nginx是默认以apache身份运行的,所以网页文件都应该以apache身份上传和创建,否则会出现权限问题
```bash
# 修改apache用户密码
passwd apache
mkdir -p /var/www
```
``` base
# apache 用户相关权限
chown apache /var/www
chgrp apache /var/www
chown apache /var/opt/remi/php71/log
chgrp apache /var/opt/remi/php71/log
```
## 启用 apache 用户 SSH 登录
修改 `/etc/passwd`
![输入图片说明](https://git.oschina.net/uploads/images/2017/0710/205927_4bdcec1c_354044.png "在这里输入图片标题")
## 开放服务端口
允许80、443等端口的访问
# 其它软件
``` bash
yum install lrzsz
yum install unzip
```