一. 域名准备
1. 解析二级域名
解析二级域名 : 我是在 阿里云上申请的 阿里云的服务器, 响应的域名也托管到了 阿里云旗下的万网上, 因此在万网上解析了二级域名;
-- 进入管理控制台 :
-- 选择域名选项 :
-- 进入域名界面 :
-- 点击添加解析 : 弹出下面的对话框;
-- 保存解析 : 点击后面的保存按钮, 即可完成二级域名的解析;
二. 网站准备
1. 解压 emlog 博客程序到指定目录
将 emlog 程序解压到一个目录 : 记录emlog目录的路径 ;
[root@ip28 fitness-emlog]# pwd
/alidata/www/fitness-emlog
[root@ip28 fitness-emlog]# cd emlog/
[root@ip28 emlog]# ls
license.txt readme.html src
[root@ip28 emlog]# cd src/
[root@ip28 src]# ls
admin config.php content favicon.ico include index.php init.php m robots.txt rss.php t wlwmanifest.xml xmlrpc.php
[root@ip28 src]#
2. 配置 nginx 服务器配置文件
配置nginx 服务器 : 进入 *nginx/conf/vhosts/ 创建一个 .conf 后缀文件, 这个就是配置文件;
server {
listen 80;
server_name www.fitness.hanshuliang.com;
index index.html index.htm index.php;
root /alidata/www/fitness-emlog/emlog/src;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
include /alidata/server/nginx/conf/rewrite/default.conf;
access_log /alidata/log/nginx/access/fitness-emlog.log;
}
3. 创建数据库
创建数据库命令 :
-- 进入数据库 : mysql -uroot -p******** , -u 后跟着用户名, -p 后跟着密码;
-- 查看数据库命令 : show databases;
-- 创建数据库命令 : create database fitness_emlog;
[root@ip28 vhosts]# mysql -uroot -p********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 642218
Server version: 5.1.63-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| han_emlog |
| han_phpwind |
| han_wordpress |
| mysql |
| test |
| weixin_tiger |
| xia_emlog |
+--------------------+
9 rows in set (0.00 sec)
mysql>
mysql> create database fitness_emlog;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| emlog_test |
| fitness_emlog |
| han_emlog |
| han_phpwind |
| han_wordpress |
| mysql |
| test |
| weixin_tiger |
| xia_emlog |
+--------------------+
10 rows in set (0.00 sec)
mysql> quit
Bye
4. 设置网站
设置网站流程 :
-- 创建成功 :
-- 进入网站 : 网址 http://fitness.hanshuliang.com ;
.