一、   环境

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

https://downloads.mariadb.org/mariadb/repositories/#mirror=syringa&distro=Ubuntu&distro_release=precise&version=10.0

安装数据库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)的更多相关文章

  1. 树莓派安装配置Nginx+PHP7+MariaDB

    原文地址:http://blog.sina.com.cn/s/blog_150f554f50102yhra.html 一.安装 Nginx 和 PHP7 1.安装Nginx sudo apt inst ...

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

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

  3. Ubuntu Nginx安装

    1.先更新ubuntu系统 更新命令 sudo apt-get update sudo apt-get upgrade 2 添加ubuntu nginx更新源镜像 cd /etc/apt/ sudo ...

  4. Ubuntu安装设置nginx和nohup常用操作

    nginx安装 Ubuntu直接从常规源中安装 apt-get install nginx 安装的目录 配置文件:/etc/nginx/ 主程序文件:/usr/sbin/nginx Web默认目录:/ ...

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

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

  6. Nginx: ubuntu系统上如何判断是否安装了Nginx?

    问题描述:ubuntu系统上,如何查看是否安装了Nginx? 解决方法:输入命令行:ps -ef | grep nginx master process后面就是Nginx的安装目录. 延伸:1. 如何 ...

  7. Centos7 编译安装 Nginx、MariaDB、PHP

    前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...

  8. ubuntu 安装flask+nginx+gunicorn 待定

    第一步 先检查服务器环境   pip python3 mysql redis 能下就下,该升级就升级 第二步 如果你的flask程序在github上 请使用git clone 地址 下载下来(如果是私 ...

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

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

随机推荐

  1. BZOJ2187:fraction

    Sol 分情况讨论 \(\lfloor\frac{a}{b}\rfloor+1\le \lceil\frac{c}{d}\rceil-1\) 直接取 \(q=1,p=\lfloor\frac{a}{b ...

  2. CSS属性之padding

    0.inline元素中的padding 大家都知道padding对于block元素和inline-block元素的影响,而对于inline元素,padding只会在水平方向产生影响,垂直方向不会产生影 ...

  3. 2 pygraphviz在windows10 64位下的安装问题(反斜杠的血案)

    可以负责任的说,这篇文档是windows10安装pygraphviz中,在中文技术网站中最新的文档,没有之一.是自己完全结合各种问题,包括调试等,总结出来的. 问题来源:主要是可视化RvNN网络的树结 ...

  4. 新建虚拟机,每次都提示无法连接虚拟设备 ide1:0

    处理方式:看到了这个老哥http://www.cnblogs.com/dean-du/p/6888513.html的博客,发现问题是一样的,所以记录一下. 将虚拟机设置中的CD/DVD选项中的连接更改 ...

  5. ubuntu16.0.4安装mysql5.7以及设置远程访问

    1.安装mysql命令 sudo apt-get install mysql-server sudo apt install mysql-client sudo apt install libmysq ...

  6. MyBatis基本配置和实践(一)

    第一步:创建Java工程和数据库表user 第二步:使用Maven管理项目依赖 第三步:在resources目录下加入log4j.properties 第四步:在resources目录下加入SqlMa ...

  7. [翻译] MJParallaxCollectionView

    MJParallaxCollectionView https://github.com/mayuur/MJParallaxCollectionView This is a parallax for t ...

  8. 用Easing函数实现碰撞效果

    用Easing函数实现碰撞效果 工程中需要的源码请从这里下载: https://github.com/YouXianMing/EasingAnimation 源码: // // ViewControl ...

  9. 沉淀再出发:关于java中的AQS理解

    沉淀再出发:关于java中的AQS理解 一.前言 在java中有很多锁结构都继承自AQS(AbstractQueuedSynchronizer)这个抽象类如果我们仔细了解可以发现AQS的作用是非常大的 ...

  10. plsql连接12cR2 PDB报错ORA-28040/ORA-01017

    http://hbxztc.blog.51cto.com/1587495/1907533 PS: 在数据库服务器上的oracle/network/admin/sqlnet.ora文件添加一行SQLNE ...