主要资料参考:https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7

1、安装 nginx:

yum install epel-release

yum install nginx  使用 yum 安装

systemctl start nginx.service  开启 nginx 服务

systemctl enable nginx.service  跟随系统启动

2、安装 MySQL(MariaDB)

yum install mariadb-server mariadb  使用 yum 安装

systemctl start mariadb  启动数据库

systemctl enable mariadb  开机启动

mysql_secure_installation  设置安全策略,会询问以下5个问题

a)为root用户设置密码
  b)删除匿名账号
  c)取消root用户远程登录
  d)删除test库和对test库的访问权限
  e)刷新授权表使修改生效

mysql -u root -p  连接数据库

连接数据库后就可以使用命令操作数据库了,如:create database wordpress; 这里我们需要先创建一个 wordpress 数据库

3、安装 PHP

yum install php php-mysql php-fpm  安装 PHP 和必须的连接 MySQL 和 Nginx 的扩展

vi /etc/php.ini  配置 PHP:

  cgi.fix_pathinfo=0  这行前的分号去掉,将1改为0

vi /etc/php-fpm.d/www.conf  编辑服务器连接配置:

  listen = /var/run/php-fpm/php-fpm.sock  将 listen 的值改为此值

  listen.owner = nobody  这行前的分号去掉

  listen.group = nobody  这行前的分号去掉

  user = nginx
  group = nginx  将这两行的值由 apache 改为 nginx

systemctl start php-fpm

systemctl enable php-fpm

4、配置 Nginx 到 PHP

vi /etc/nginx/conf.d/wordpress.conf

server {
listen 80;
server_name tirion.me www.tirion.me; # note that these lines are originally from the "location /" block
root /home/www/wordpress; # 配置 wordpress 的目录路径
index index.php index.html index.htm; location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

systemctl restart nginx

*上传文件默认为1M,需要修改 nginx.con, nginx.conf.default 和 php.ini 文件来配置上传文件的大小。


5、安装 FTP

yum install vsftpd  安装 FTP 服务

systemctl start vsftpd.service

systemctl enable vsftpd.service

vi /etc/vsftpd/vsftpd.conf  修改 FTP 配置:

  anonymous_enable=NO  这行改为 NO,不允许匿名登录

允许 root 用户使用 FTP:

  vi /etc/vsftpd/ftpusers 去掉或注释掉 root

  vi /etc/vsftpd/user_list 去掉或注释掉 root

配置 iptables:

  iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT

systemctl restart vsftpd.service  重启 FTP 服务

6、安装 WordPress

1) 从 https://cn.wordpress.org/ 下载 WordPress 安装包,解压后通过 FTP 上传到服务器相应的目录,这里就是 /home/www/wordpress

2) chmod 777 -R wordpress  给 WordPress 权限

3) 通过 url 访问:http://tirion.top/wp-admin/install.php 进行自动安装

4) 根据需要进行配置 MySQL 连接的用户名、密码、使用的数据库名,进行安装即可

7、安装 phpmyadmin 参考:

http://www.smalljacky.com/linux/centos/centos7-install-setup-nginx-mariadb-php-phpmyadmin-lemp/

CentOS 7 安装 WordPress,PHP,Nginx,MySQL(MariaDB),FTP的更多相关文章

  1. CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...

  2. [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)

    LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...

  3. CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...

  4. centos7安装Lnmp(Linux+Nginx+MySql+Php+phpMyAdmin+Apache)

    centos7安装Lnmp(Linux+Nginx+MySql+Php)及Apache   Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx是一个高性能的HTTP和反向代理服务器,Ng ...

  5. 于CentOS 6 安装 Wordpress

    1.两种方式给Wordpress 首先,你可以去wordpress最新的官方网站看看wordpress多少下载.例wordpress 3.9.1下载地址: http://cn.wordpress.or ...

  6. centos下gitlab私服完整安装部署(nginx+MySQL+redis+gitlab-ce+gitlab-shell+)

    系统环境cat /etc/redhat-release CentOS release 6.8 (Final) nginx -vnginx version: nginx/1.9.15 redis-cli ...

  7. CentOS 7安装WordPress

    在开始本文前,我假定你已经安装好了nginx.php-fpm和mariaDB(或mysql).它们的安装过程可参考我以前的文章. 1. 安装EPEL(Extra Packages for Enterp ...

  8. CentOS 7 安装php5.6,Nginx,Memcached环境及配置

    安装php5.6版本以后不再需要安装Zend Guard,而是用yum命令安装php-opcache及php-pecl-apcu就可以有效的提高php执行速度. 1. 配置yum源 事先确认yum源的 ...

  9. centos 快速安装wordpress

    1.两种方式得到Wordpress 首先你可以去wordpress官方网站看下最新的wordpress的下载地址多少.比如wordpress 3.9.1的下载地址是: http://cn.wordpr ...

随机推荐

  1. git 小结

    git cherry-pick de0ec64  可将另一个分支中的提交 cherry-pick到当前分支来

  2. selenium+python环境搭建

    1.安装python-2.7.3.msi 2.安装pywin32-216.win32-py2.7.exe 3.下selenium包,selenium-2.35.0.tar.gz,放到D:\autote ...

  3. AngularJS身份验证:Cookies VS Tokens

    基于cookie的身份验证:Cookie-Based Authentication 基于token的身份验证:Token-Based Authentication 跨域:cross-domain 说明 ...

  4. red hat enterprise 6安装tftp服务

    1--->检查是否安装tftp rpm -qa tftp* 2--->安装tftp yum install -y tftp-server 3--->chkconfig --list| ...

  5. Number of 1 Bits(Difficulty: Easy)

    题目: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also ...

  6. .net dataGridView当鼠标经过时当前行背景色变色;然后【给GridView增加单击行事件,并获取单击行的数据填充到页面中的控件中】

    1.首先在前台dataGridview属性中增加onRowDataBound属性事件 2.然后在后台Observing_RowDataBound事件中增加代码 protected void Obser ...

  7. Python基础知识之排序法

    在Python开发中,我们会经常使用到排序法,排序的最简单的方法是用sort(list)函数,它接受一个列表并返回与有序的元素一个新的列表. 原始列表不被改变. a = [5, 1, 4, 3]    ...

  8. Hadoop YARN中内存的设置

    在YARN中,资源管理由ResourceManager和NodeManager共同完成,其中,ResourceManager中的调度器负责资源的分配,而NodeManager则负责资源的供给和隔离.R ...

  9. ARM9的中断控制器

    简要复习一下ARM9中断控制器的控制过程: 1.首先能识别触发的中断(对应中断源必须打开,然后查询当前中断状态寄存器),硬件会操控PC跳到中断向量入口(IRQ_HANDLE,硬件控制的只要是IRQ中断 ...

  10. VS2010+PCL配置

    原文出自(转载): http://blog.csdn.net/renshengrumenglibing/article/details/9073675 1.安装 pcl 的完全安装包可以到: http ...