CentOS 7 安装 WordPress,PHP,Nginx,MySQL(MariaDB),FTP
主要资料参考: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的更多相关文章
- CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...
- [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)
LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...
- CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...
- centos7安装Lnmp(Linux+Nginx+MySql+Php+phpMyAdmin+Apache)
centos7安装Lnmp(Linux+Nginx+MySql+Php)及Apache Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx是一个高性能的HTTP和反向代理服务器,Ng ...
- 于CentOS 6 安装 Wordpress
1.两种方式给Wordpress 首先,你可以去wordpress最新的官方网站看看wordpress多少下载.例wordpress 3.9.1下载地址: http://cn.wordpress.or ...
- 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 ...
- CentOS 7安装WordPress
在开始本文前,我假定你已经安装好了nginx.php-fpm和mariaDB(或mysql).它们的安装过程可参考我以前的文章. 1. 安装EPEL(Extra Packages for Enterp ...
- CentOS 7 安装php5.6,Nginx,Memcached环境及配置
安装php5.6版本以后不再需要安装Zend Guard,而是用yum命令安装php-opcache及php-pecl-apcu就可以有效的提高php执行速度. 1. 配置yum源 事先确认yum源的 ...
- centos 快速安装wordpress
1.两种方式得到Wordpress 首先你可以去wordpress官方网站看下最新的wordpress的下载地址多少.比如wordpress 3.9.1的下载地址是: http://cn.wordpr ...
随机推荐
- 百度地图结合echarts并添加行政区块
作者:LJaer链接:https://www.zhihu.com/question/49251513/answer/125728764来源:知乎<!DOCTYPE html> <ht ...
- php 网页 301 跳转
php 跳转 if('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] =="http://www.nikemalaysia.co ...
- struts2 错误提示页面
以前做的一个网站,最近服务器后台出现一些异常,问题是客户访问一个该网站下不存在的action,为了给客户一个友好的界面提示以及减小服务器端日志文件的内容.就在struts2下进行了如下配置: 在str ...
- Python学习之变量
Python 变量 python不用事先声明变量,赋值过程中就包含了变量声明和定义的过程 用“=”赋值,左边是变量名,右边是变量的值 数字 整数 int_var = 1 长整数 long_var = ...
- Android Studio Problem : failed to find style 'textviewstyle' in current theme 解决方法
新建一个空白的MainActivity时Preview就出现一个错误: failed to find style 'textviewstyle' in current theme 开始在国内的博客平台 ...
- REVERSE-极客大挑战-geek2.apk
嗯 一道apk的题目,题目本身并不是很难,但是我用的python却坑了我小半天...不过在纠错的过程中我也学到了不少东西 链接:http://pan.baidu.com/s/1i5LkJDr 密码: ...
- NOIP 考前 数论复习
POJ 2891 x=r1 (mod a1) x=r2 (mod a2) x=a1*x+r1,x=a2*y+r2; a1*x-a2*y=r2-r1; 用Extend_Gcd求出m1*x+m2*y=d; ...
- Fedora下的解压
Fedora下解压缩的相关操作 以下内容转载自互联网,仅供个人学习之用. 对于刚刚接触Linux的人来说,一定会给Linux下一大堆各式各样的文件名给搞晕.别个不说,单单就压缩文件为例,我们知道在Wi ...
- 将十六进制的字符串转化为UIImage
最近写一个项目,有验证码,但是接口返回的并不是验证码图片的URL,而是返回的字节数组16进制字符串.这样就需要把16进制字符串首先字节数组,其次再把字节数组转化为NSData,最后再把NSData转化 ...
- 项目中创建单元测试—VS2012
我们在每个项目的开发过程中,开发完一个功能,自己首先需要测试一下,VS提供了很方便的测试功能,可以很容易的创建单元测试,但是在VS2012中类名上点击右键没有『创建单元测试』这个菜单,需要先进行设置一 ...