【站点部署】解析二级域名并部署站点



开设原因 : 近期在学健身, 上一份工作辞掉后, 在北京找了家私人教练培训学校, 进行为期四个月的健身培训, 这个比在健身房找私教专业多了, 被健身房私人教练坑慘了, 说多了都是泪, 已经培训了将近一个半月, 学习了基础私教, 普拉提, 这在学习康复课程, 之后还有功能性 和 综合格斗, 健美备赛 课程, 准备将学到的东西整理到博客上, 我本人也会将学到的东西分享给大家, 学习完之后继续做 Android 码农;




一. 域名准备



1. 解析二级域名



解析二级域名 : 我是在 阿里云上申请的 阿里云的服务器, 响应的域名也托管到了 阿里云旗下的万网上, 因此在万网上解析了二级域名;

-- 进入管理控制台


-- 选择域名选项


-- 进入域名界面


-- 点击加入解析 : 弹出以下的对话框;


-- 保存解析 : 点击后面的保存button, 就可以完毕二级域名的解析;






二. 站点准备



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 后跟着username, -p 后跟着password;

-- 查看数据库命令 : 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 ;





.



原文地址:https://www.cnblogs.com/cxchanpin/p/7222509.html