wordpress安装(ubuntu+nginx+php+mariadb)
一、 环境
ubuntu12.04.4
nginx 1.6.0
mariadb 10.0
更新系统补丁
sudo apt-get update
sudo apt-get dist-upgrade -y
挂载swap分区
dd if=/dev/zeroof=/media/fasthdd/swapfile.img bs=1024 count=1M
mkswap /media/fasthdd/swapfile.img
sudo vim /etc/fstab
/media/fasthdd/swapfile.img swap swap sw 00
swapon /media/fasthdd/swapfile.img
cat /proc/swaps
grep 'Swap' /proc/meminfo
二、 安装nginx
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
在/etc/apt/sources.list末尾添加
deb http://nginx.org/packages/ubuntu/ precise nginx
deb-srchttp://nginx.org/packages/ubuntu/ precise nginx
sudo apt-get update
sudo apt-get install nginx -y
三、 安装PHP
sudo apt-get installpython-software-properties
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get install -y php5 php5-mysqlphp5-fpm
四、 安装数据库MariaDB
安装数据库MariaDB10.0
sudo apt-get installpython-software-properties -y
sudo apt-key adv --recv-keys --keyserverhkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'debhttp://mirrors.syringanetworks.net/mariadb/repo/10.0/ubuntu precise main'
sudo apt-get update
sudo apt-get install mariadb-server -y
查询DB编码
mysql -uroot -p
show variables like 'character\_set\_%';
sudo vim /etc/mysql/my.cnf
默认UTF8,不用加,加以下会出错
default-character-set=utf8
init_connect='SETNAMES utf8'
加入到[mysqld]
lower_case_table_names=1
skip-name-resolve
sudo /etc/init.d/mysql reload
五、 部署wordpress
下载wordpress的tar包,解压并拷贝至/home/www/www
sudo chown -R nginx:nginx /home/www/www
sudo chmod -R 711 /home/www/www
配置nginx站点
sudo vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo=1
sudo vim /etc/php5/fpm/pool.d/www.conf
user = nginx
group = nginx
listen.mode= 0666
sudo /etc/init.d/php5-fpm restart
#将socket文件,放在内存文件区域,有利于提升性能
sudo vim /etc/nginx/conf.d/default.conf
##########################################################
server {
listen 80;
server_name *.aser.me aser.me*.showall.org showall.org;
root /home/www/www;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri//index.php?$args ;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_passunix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /home/www/www$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ /\.ht {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
}
##########################################################
sudo service php5-fpm restart
sudo service nginx restart
配置wordpress数据库
sudo vim /etc/hosts
127.0.0.1 dbhost
建立wordpress库
mysql -uroot-p
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"dbhost" IDENTIFIED BY "password";
GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"localhost" IDENTIFIED BY "password";
GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"127.0.0.1" IDENTIFIED BY "password";
FLUSH PRIVILEGES;
EXIT;
配置wordpress连接数据库的信息
sudo cp -rp wp-config-sample.phpwp-config.php
sudo vim /home/www/www/wp-config.php
define('DB_NAME','wordpress');
define('DB_USER','wordpress');
define('DB_PASSWORD','password');
define('DB_HOST','dbhost');
更安全更详细设置参考:
http://conanca.iteye.com/blog/1044256
http://codex.wordpress.org/zh-cn:%E5%AE%89%E8%A3%85_WordPress
http://codex.wordpress.org/Nginx
http://wiki.nginx.org/WordPress
wordpress安装(ubuntu+nginx+php+mariadb)的更多相关文章
- 树莓派安装配置Nginx+PHP7+MariaDB
原文地址:http://blog.sina.com.cn/s/blog_150f554f50102yhra.html 一.安装 Nginx 和 PHP7 1.安装Nginx sudo apt inst ...
- CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...
- Ubuntu Nginx安装
1.先更新ubuntu系统 更新命令 sudo apt-get update sudo apt-get upgrade 2 添加ubuntu nginx更新源镜像 cd /etc/apt/ sudo ...
- Ubuntu安装设置nginx和nohup常用操作
nginx安装 Ubuntu直接从常规源中安装 apt-get install nginx 安装的目录 配置文件:/etc/nginx/ 主程序文件:/usr/sbin/nginx Web默认目录:/ ...
- CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...
- Nginx: ubuntu系统上如何判断是否安装了Nginx?
问题描述:ubuntu系统上,如何查看是否安装了Nginx? 解决方法:输入命令行:ps -ef | grep nginx master process后面就是Nginx的安装目录. 延伸:1. 如何 ...
- Centos7 编译安装 Nginx、MariaDB、PHP
前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...
- ubuntu 安装flask+nginx+gunicorn 待定
第一步 先检查服务器环境 pip python3 mysql redis 能下就下,该升级就升级 第二步 如果你的flask程序在github上 请使用git clone 地址 下载下来(如果是私 ...
- [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)
LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...
随机推荐
- python学习之老男孩python全栈第九期_day020知识点总结——序列化模块、模块的导入和使用
一. 序列化模块 # 序列化 --> 将原本的字典.列表等内容转换成一个字符串的过程就叫做序列化# 反序列化 --> 从字符串转换成数据类型的过程叫做反序列化# 序列 -- 字符串 # 什 ...
- js数组的forEach方法能不能修改数组的值
如果要使用数组的forEach()方法对其改值时,需要直接通过arr[i]这种方式来更改. 请看下面代码: // 数组改值 let arr = [1,3,5,7,9]; arr.forEach(fun ...
- sublime3下载安装及常用插件、浏览器预览设置
之前与学习前端有关的软件都安装在了实验室电脑上,最近由于要放寒假(也许我寒假回去会学习呢),于是得在笔记本电脑上重新安装一遍.几个软件各种出错,花了一下午才安装好,必须记录下来啊! 这篇文章主要介绍s ...
- 关于Bootstrap的悬浮窗口(popover)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- PHP匿名函数(闭包)
匿名函数(Anonymous functions),也叫闭包函数(closures),允许 临时创建一个没有指定名称的函数.最经常用作回调函数(callback)参数的值.当然,也有其它应用的情况. ...
- PRINCE2是什么意思?
PRINCE2是一种长期以来公认的项目管理方法,在英国公共部门广泛应用,在私营企业界也发展成为事实上的应用方法. PRINCE2开发于1989年,是一种结构性的项目管理方法,其所有者OGC(英国商务部 ...
- 屏幕录像LICEcap
简介 LiceCap是一款轻量级屏幕录制工具 官网链接 windows版下载链接 Demo 以下是访问http://www.cockos.com/licecap/的屏幕录像
- Windows 10 host where Credential Guard or Device Guard is enabled fails when running Workstation (2146361)
To disable Device Guard or Credential Guard on Itanium based computers: Disable the group policy set ...
- leetcode Ch2-Dynamic Programming I
一. 1. Edit Distance class Solution { public: int minDistance(string t1,string t2) { int len1=t1.size ...
- Linux动态链接库.so文件的创建与使用
1. 介绍 使用GNU的工具我们如何在Linux下创建自己的程序函数库?一个"程序函数库"简单的说就是一个文件包含了一些编译好的代码和数据,这些编译好的代码和数据可 ...