Website development: from writing code to the public network access to the entire process (CSDN Essay Contest winners of the first article)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/sunnyzyq/article/details/95062942

[Acceptance speech] July 18, 2019 

Thanks CSDN gave me this honor, let me winning this article in the first issue CSDN Essay Contest!

Had not thought to receive this honor, just want a good summary to help more friends!

Thank CSDN!! Thank you to all points like the support of friends! !

Winners Source: https://blog.csdn.net/blogdevteam/article/details/94545970

---------------------------------------------------------------------------------------------------

Here to talk about my own first site, the entire process from development to access.

[Introduction]

I believe that most developers just joined the company, basically writing business code, the result of two or three years down the code found myself really write good-looking than before, but on the whole site from development to process on-line , but still a loss. Of course, including me, but under the recent spat finally completed this entire process.

 

[1] Create a Web site project

The first step nothing to say, in your local development tools in (I am here is Eclipse), create a Web site project, write code for your site functions.

Well, this is my next website project.

If a friend is not clear throughout the project to build the ins and outs, I suggest you take a look at the following article.

Related Recommendation: Springboot project to build (the front end to a database, ultra-detailed)

 

[2] buy a domain name

(2.1) domain name what's the use?

Since you want people to visit your site, first be sure to buy one of their own domain name, do you want the user to enter an IP address to access.

For example: Baidu site's domain name is baidu.com, and my domain is: sunnyzyq.cn

The front of the URL http: // www or https:.. // www is a variety of protocols, and their combined domain names has become a full URL.

Such as: https://www.baidu.com (Baidu), http://www.sunnyzyq.cn (my personal website)

Domain name suggested retail price of around: $ 30 / year, you better not be fucked!

(2.2) where you can buy domain names?

There are many places to buy the domain name, what Ali cloud, cloud Tencent, Huawei cloud, just a Baidu search "domain name to buy" you can see.

(2.3) when buying a domain name, first let you choose the type of domain name, fill in the domain name, and then click the query.

(2.4) if the domain name already exists, it will prompt you, the domain name is not registered, then you need to re-think a return. 

(2.5) if you want the domain OK, it is not registered, it will prompt you for domain name price, then this time you can click on the register.

(2.6) the registration process, you will fill out some information, Chinese characters are able to understand, here is not described in detail, according to their own need to fill.

(2.7) domain name for the record

After purchasing a domain name on the website, then you need to domain name registration, your information is to be registered in the network Authority (HKMA).

(2.8) why the domain name for the record?

Domain name registration need to fill all kinds of things about your future as long as your website as long as there are some things that do not comply with national laws and regulations, once they are discovered or reported, they can find you through these, according to which of the regulations deal with how to deal with it how to deal with.

So their website do not do these things involve bad, once reported, above you will definitely find you.

(2.9) How domain name for the record?

I will not describe specifically how to record in detail, and generally buy the domain name sites have customer service little sister, looking for her on the right.

首先会让你填写好备案的基本信息,然后照几张手持身份证的照片(通常网站还要寄给你一张背景海报来照),填好了之后,购买域名的地方会进行初级审核,如果他觉得OK了,那么他再继续向上(管局)提交,网管局里觉得OK了,那么才算是基本OK。

(2.10)管局审核一般需要多久?

每个省每天备案的网站有多有少,所以审核的时间不同,下面有大神总结的一份各省备案通过时间。

【各省备案审核时间】http://bbs.qcloud.com/thread-20191-1-1.html

具体多久呢?我实际的情况给你们感受下吧!(四川省)

(2.11)域名管局审核通过之后,你就会拿到一个备案号(如:京公网安备11000002000001号 ) ,并且上面还会不定时的抽查打电话询问当前服务器是否自己在使用。

 

【3】购买云服务器

(3.1)为什么要购买云服务器?

你的网站要让别人访问,你也肯定想要有一个专业的地方代你保管,而且24小时访问吧!

如果买不起?可以!那就像我一样,老老实实的租一个吧!其实租也不便宜,大致价位为60元/月,如果你打算长期用,那就按年买吧,如果你只是想体验下整个流程,买1个月即可。

(3.2)在哪里购买/租用云服务器?

我百度搜“云服务器”,相信我,前3个答案都是你想要的。

(3.3)你的云服务器买好之后,进入后台云服务器管理,你就可以拿到一个IP,以及远程登录的帐号和密码(后面网站发版需要用到的)。

 

【4】域名解析

(4.1)什么是域名解析?

你买了域名之后,如果什么都不做,凭什么输入域名后就要跳转到你的网站上,而不是跳到我的网站?总得要发生点什么关系。

所谓域名解析,就是将一个IP和域名进行绑定,这样你访问域名的时候,域名解析协议就知道你要到哪个IP上了,然后访问你的云服务器上的程序。

(4.2)如何域名解析?

你购买了云服务器后,会得到一个IP地址,然后找卖云服务器的小姐姐客服,你说我要域名解析,她会教你在该怎么做的。
域名解析后,等上一段时间(五到五十分钟不等),如果能Ping通,这说明已经绑定成功了。

 

【5】安装WinSCP

(5.1)WinSCP是什么?

简单的说,通过这个,可以把你自己电脑上的东西,上传到你的云服务器上。我们已经开发好的网站,总得放上去撒运行吧!

(5.2)WinSCP下载与安装

下载地址:http://www.mydown.com/soft/433/473302433.shtml

如何安装我就不截图说明了,一路next到底即可。

(5.3)打开WinSCP,新建远程链接

(5.4)新建之后,出现这个界面,还记得上面你购买云服务器后,给你的相关信息吗?把他们填到这里!

建议填写之后点击【保存】,可以避免下次登录再填写(当然,如果你喜欢每次都来填写一遍加深记忆,就当我没说)。

 (5.5)保存之后,初始界面就会多一个这样的记录了。

(5.6) 选中它,然后进行登录。

(5.7)然后我们就进入了下面这个页面,左边1这块儿乱哄哄的,一看就知道是笔者的电脑桌面;右边2这块儿看上去没什么东西的,就是你云服务器了上的东西了,和你的电脑差不多,都是文件和文件夹的模式管理。

(5.8)通过这样,你就可以看到你云服务器上有哪些东西了,如果你要上传一个文件到云服务器上,只需要点击左边自己电脑对应的文件,拖到右边即可。当然,也可以从你电脑其他地方ctrl+c你的东西,然后ctrl+v到2部分的空白处完成上传。

这个上传速度由你的网速和你买的云服务器带宽所决定,像我这个,基本上都是维持在200-300KB/s

 

【6】安装Putty

(6.1)什么是Putty?

简单的说,就是可以通过这个东西,然后用Linux命令操控你的云服务器。

如果你和我之前一样,对Linux是个小白,甚至基本的命令都不知道,那么你可以收下我整理的这份内容,这是我在使用中学到的一些常用命令的整理。

相关推荐:Linux 常用命令

(6.2)为什么选择Putty?

管理Linux命令的工具众多,大众都喜欢用Xshell,每个人都有自己的爱好,你喜欢用什么就用什么吧。这仅仅是一个管理工具而已。

我喜欢用Putty,因为Putty和WinSCP是配套的。

(6.3)Putty下载与安装

这篇文章里说的很好,我就不累述了,相关链接:http://www.onlinedown.net/soft/2186.htm

(6.4)安装完成后,打开昨天的WinSCP面板,点击这个图标,进入Putty终端命令行操作。

 (6.5)进来之后,就得到了这个界面

(6.6) 你可以在命令行输入一个ls,查看当前目录下的文件,可以看到这个命令行已经罗列了所有明文件(前缀带点的是隐藏文件,一般来说,隐藏文件保存了重要的相关数据,就是让你看不见,避免让你手残删除),这也说明了,你从WinSCP的那个面板进入Putty,Putty就打开时就在哪个相对应的路径。

 

【7】安装JDK

(7.1)安装JDK(如果是Java写的程序)

这个就不用多说了撒,Java项目运行的基础环境,你本地Window运行Java项目还得安装JDK呢,凭什么Linux上面就不需要?

(7.2)下载与安装

重复+1:别人总结的比我好,给你们推荐几个,不够自己再去问度娘:

推荐一:https://www.cnblogs.com/liushuchen/p/7804160.html

推荐二:https://www.cnblogs.com/fangts/p/8947230.html

推荐三:https://www.cnblogs.com/wenbinshen/p/9049447.html

 

【8】安装Tomcat

网站发布程序,需要一个Web容器,当初你学的时候,老师我想是应该教过你的。任何网站都需要放在服务器上的web容器里后,才能进行访问(当然,如果你和我一样是Springboot项目的话,可以不用安装,Springboot项目自带Tomcat实现)。

如果你的项目还没有自带Web容器的话,那么就老老实实的安装一个:

重复+2:别人总结的比我好,给你们推荐几个,不够自己再去问度娘:

推荐一:https://blog.csdn.net/a_18397219871/article/details/79466392

推荐二:https://www.cnblogs.com/xdp-gacl/p/4097608.html

推荐三:https://www.cnblogs.com/0201zcr/p/4723798.html

 

【9】安装数据库

(9.1)我也不想在写为什么要安装数据库之类的话了,如果你真不知道,请允许我给你一个白眼,然后你自己去问百度娘吧。

下载过程推荐我自己的总结:下载Mysql(图文解说)

安装过程如下:

重复+3:别人总结的比我好,给你们推荐几个,不够自己再去问度娘:

推荐一:https://www.cnblogs.com/duanrantao/p/8988116.html

推荐二:https://www.cnblogs.com/luckycn/p/7289995.html

推荐三:https://www.cnblogs.com/fanshudada/p/9781794.html

(9.2)安装好之后,记得创建一个表试试,看看是否真正可运行。

这是常用的 Linux mysql 操作命令,下面这位兄弟整理得很奈斯:

相关推荐:linux 下 mysql 常用命令

 

【10】本地电脑安装Navicat

(10.1)Navicat是什么?

Navicat是一款数据库管理工具,如果你想直观的看你的数据库,而不是通过敲命令的方式去查看,据猜测统计,99%开发的人员都在用。

(10.2)Navicat下载与安装

下面这篇文章,简单粗暴,安装破解,一气呵成,好评如潮,强烈推荐:

相关推荐:Navicat for MySQ中文破解版(无需激活码)

 

【11】打包你的项目

(11.1)如果你也是java项目,那么就先将本地项目打成jar包吧。

Maven项目打包后,target中会有相关jar包,然后 ctrl+c 复制当前Jar包。

 (11.2)然后拷贝到你的云服务器上。

 

【12】启动项目

(12.1)打开Putty,进入你的Jar包所在的目录,然后命令启动你的项目Jar包

启动命令:nohup java -jar xxx.jar &

 

 (12.2)如果你的项目有更新,然后重新上传了Jar包,那么你需要在上传前,先将原来的项目进程杀死,然后重新启动,才能够生效。

输入下面命令,查看原先的进程号,这里我的该项目的进程号是23814:

ps -aux | grep java

(12.3)然后杀死该进程(kill 进程号)。

kill 23814

(12.4)然后再次查看进程,如果没有该进程,说明可以重新发版(我们通常将拷贝Jar包到服务器上,然后启动Jar包,直到可以访问的过程称之为发版)。发版完成后,你就可以访问你的网站了。

【13】网站访问

这一步其实写了当没写,既然标题都说了,从写代码到访问,自然还是得有个访问页面,标志文章的结束。

诺,这就是我的第一个网站,上面鬼都没有,完全是花钱买服务器和域名,学习经验。

 

【总结】

这就是整个网站的诞生过程,从开发,到线上访问,大致如上所述,如果你从未试独自完整试过,我相信你还是需要一定的时间来慢慢了解,毕竟这么多步骤和软件的安装,是需要慢慢整理的。

下面是我当时遇到的一些问题,以及相关总结,这些我已经整理成章,希望对你有用:

(1)Maven打包不执行测试用例

(2)Linux执行Jar包: no main manifest attribute

(3)Linux查看端口使用情况

(4)通过端口查看进程

(5)Mysql常用命令

(6)Linux 常用命令

(7)root 用户下显示 -bash-4.2#,如何恢复正常?

(8)Linux下安装vim编辑器

----------------------------------------------------------------------------------

既然都看到这里了,点个赞不为过吧!有问题欢迎留言讨论!

我不是技术大牛,以后也只会分享更多的小白教程给大家!!

          谢谢观看!THANK YOU!祝你快乐每一天! 

-----------------------------------------------------------------------------------

Guess you like

Origin blog.csdn.net/sunnyzyq/article/details/95062942