使用WordPress搭建个人博客

本文基于LAMP+WordPress搭建个人博客,系统和软件的配置如下:

       Linux:CentOS6.5

       Apache:Apache/2.2.15(Unix)

       Mysql:mysql-5.1.73-3.el6_5.i686

       Php:PHP 5.3.3

      

       WordPress是一款开源的博客系统,支持大量的插件和主题更换,得到了广泛的应用。

 

1.下载最新版的wordpress

# cd /tmp

# wget http://wordpress.org/latest.tar.gz

2.解压缩包

# tar –xzvflateste.tar.gz –C /var/www/html

3.为wordpress创建数据库

## Connect to MySQL Server & Enter Password (ifany or leave blank)##

# mysql –u root –p

# Enter Password:

 

## Creating New User for WordPress Database##

CREATE USER wordpress@localhost IDENTIFIED BY "your_password_here";

 

## Create New Database ##

create database wordpress;

 

## Grant Privileges to Database ##

GRANT ALL ON wordpress.* TO wordpress@localhost;

 

## FLUSH privileges ##

FLUSH PRIVILEGES;

 

## Exit ##

Exit

4.为wordpress创建虚拟主机

使用vi编辑器打开/etc/httpd/conf/httpd.conf

# vi/etc/httpd/conf/httpd.conf

如下配置:

<VirtualHost *:80>

    ServerAdminjefby@jefby.com

    DocumentRoot/var/www/html/wordpress

    ServerName wordpress

    ErrorLog/var/log/httpd/wordpress-error-log

    CustomLog/var/log/httpd/wordpress-acces-log common

</VirtualHost>

接着重启Apache服务器,

#service httpdrestart

在/etc/hosts中添加上对wordpress的解析

127.0.0.1wordpress

 5.    配置wordpress

 # cd /var/www/html/wordpress

# cp wp-config-sample.phpwp-config.php

和如下进行对比,修改wp-config.php中的相关内容

 

// ** MySQL settings - You can get thisinfo from your web host ** //

/** The name of the database for WordPress*/

define('DB_NAME', 'database_name_here');

 

/** MySQL database username */

define('DB_USER', 'username_here');

 

/** MySQL database password */

define('DB_PASSWORD', 'password_here');

 

/** MySQL hostname */

define('DB_HOST', 'localhost');

 

/** Database Charset to use in creatingdatabase tables. */

define('DB_CHARSET', 'utf8');

 

/** The Database Collate type. Don't changethis if in doubt. */

define('DB_COLLATE', '');

6.       完成wordpress的安装

在局域网的其他机器上打开安装wordpress机器的ip地址,例如安装wordpress的机器IP为10.0.5.1,测试客户机器为10.0.5.189,打开浏览器,输入http://10.0.5.1,设置标题,创建管理员账号,创建管理员密码和Email,然后点击安装。完成后登录,创建博文即可。

参考文章:点击打开链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值