前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【网站部署】解析二级域名并部署网站

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

作者头像
韩曙亮
发布2023-03-27 13:59:26
2.1K0
发布2023-03-27 13:59:26
举报
文章被收录于专栏:韩曙亮的移动开发专栏

一. 域名准备

1. 解析二级域名

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

-- 进入管理控制台

-- 选择域名选项

-- 进入域名界面

-- 点击添加解析 : 弹出下面的对话框;

-- 保存解析 : 点击后面的保存按钮, 即可完成二级域名的解析;

二. 网站准备

1. 解压 emlog 博客程序到指定目录

将 emlog 程序解压到一个目录 : 记录emlog目录的路径 ;

代码语言:javascript
复制
[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 后缀文件, 这个就是配置文件;

代码语言:javascript
复制
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;

代码语言:javascript
复制
[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 ;

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015-08-21,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一. 域名准备
    • 1. 解析二级域名
    • 二. 网站准备
      • 1. 解压 emlog 博客程序到指定目录
        • 2. 配置 nginx 服务器配置文件
          • 3. 创建数据库
            • 4. 设置网站
            相关产品与服务
            数据库
            云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档