首先把yum源修改为阿里的yum源,如果没有安装wget,先安装一个。(如果有请蹦过)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install wget -y

备份本地yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

获取阿里yum源配置文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装epel源

yum install epel-release

安装环境

sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install php php-fpm php-mysql nginx mariadb-server php-gd* -y

修改php-fpm文件

vi /etc/php-fpm.d/www.conf

启动服务

systemctl start php-fpm
systemctl start nginx

简单配置 数据库

systemctl start mariadb
mysql_secure_installation
Enter current password for root (enter for none): #初次运行直接回车
Set root password? [Y/n] #是否设置root用户密码,输入y并回车或直接回车
New password: #设置root用户的密码
Re-enter new password: # 再输入一次你设置的密码
Remove anonymous users? [Y/n] # 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] #是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] # 是否删除test数据库,回车
Reload privilege tables now? [Y/n] # 是否重新加载权限表,回车

root 用户支持远程访问

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
flush privileges;

配置Nginx文件

新建配置文件

vi /etc/nginx/conf.d/www.a.com.conf

文件内容

server {

  listen 80;
server_name www.a.com;
set $root /var/www/myweb; #listen 443 ssl;
#ssl_certificate *.pem;
#ssl_certificate_key *.key;
#ssl_session_timeout 5m;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_prefer_server_ciphers on; location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
root $root;
client_max_body_size 100M;
}
location / {
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
root $root;
client_max_body_size 100M;
}
location ~ \.php/?.*$ {
root $root;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params; set $fastcgi_script_name2 $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
set $fastcgi_script_name2 $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
client_max_body_size 100M;
}
include /etc/nginx/mime.types;
default_type application/octet-stream; }

重新加载配置文件

nginx -s relaod

最新文章

  1. Windows 10 密钥分享
  2. python之路4
  3. tips of my ubuntu 16.04 LTS
  4. 淘宝(阿里百川)手机客户端开发日记第六篇 Service详解(一)
  5. S2SH商用后台权限系统第二讲
  6. 【转】android cts failed items
  7. C# MVC 自学笔记—4 添加视图
  8. Visibility属性实现自动隐藏功能
  9. 深入剖析ConcurrentHashMap 一
  10. C#中的协变(Covariance)和逆变(Contravariance)
  11. 为什么.Net平台不支持程序集卸载(Assembly.Unload)?
  12. 利用ScrollView滑动属性实现点击查看更多
  13. MySQL的GROUP_CONCAT函数
  14. Java synchronized 线程同步
  15. 同步方法、同步代码块、volidate变量的使用
  16. Huawei® ENSP & VRP CheatSheet
  17. Ubuntu:双(多)网卡绑定(bonding)配置
  18. Linux command stty
  19. css , dl , dt , dd 的使用. calc
  20. time,datetime模块

热门文章

  1. vue2.0中文文档
  2. MVVMLight学习笔记(一)---MVVMLight概述
  3. css - 样式 - 可见性
  4. docker《三》单机部署项目容器,nginx负载均衡
  5. vue项目梳理
  6. Java - 记录01_开发环境搭建
  7. MySQL高可用主从复制新增slave
  8. Python3-sqlalchemy-orm 分组统计
  9. K8s配置。--未完成
  10. Mybatis-Plus增强包