Deployment of Java Web project on the cloud Ali

Deployment of Java Web project on the cloud Ali

first step:

Ali buy a cloud server. I purchased a Windows Server 2012 R2 Datacenter Edition (64-bit Chinese edition).

Step two:

Password setting example (FIG right below "Password / Key" which is provided) in the instance of the cloud server management console interface which, in this example the password is to be used in a remote connection, the remote connection will be described in detail below.

third step:

Remote connection, and then configure the environment. (You can also set a password to connect remotely instance, click on the image above to achieve remote connection is connected, but not very smooth after the connection does not seem to share local data, it is recommended to use the following way)

Remote connection steps as follows.

(1) win + r-> Enter enter mstsc -> click on the lower left corner of the "Display Options"

(2) entered in the computer field: public network IP, (buy cloud server public IP, public network ip ip address is the external network access) -> In the User Name field, enter: Administrator

(3) Click the "local resources" -> Details -> select the local disk you want to share, I chose the C drive (because we need to copy the relevant files from a local on the remote host, so you need to share a local disk to remote server so that the server can access the data shared disk.)

the fourth step:

Step this step is not specified, the realization of a disk sharing, you need to configure the environment needs of the project on the cloud server (copy the installation files to the cloud server can be, configured and installed some of the resources of the environment and on their computers the same).

Specific operation is as follows.

Location of the file first operation to achieve the above remote connections, open the following interface, found on your computer needs to be copied to the cloud server (on the "Local Disk (C :)").

The following are the files I need.

For Java Web projects need to configure the environment variables installed jdk, tomcat, MySQL and so on. On their computers how to configure the installation of following suit on a cloud server can be, there is no difference.

the fifth step:

After configuring the installed thing if you want to access external networks need an operation.

Port 8080 that is released by a security group, follow the steps in the cloud server management console.
The cloud server ECS-> Examples -> Administration -> the present example Security Group -> Configuration Rule -> Rule add the security group (set according to the FIG.)

完成上述设置之后,应该就可以通过http://外网ip:8080访问Tomcat界面了(我是可以了),若可以则证明成功,若不可以也许是防火墙等问题,可针对特定问题搜索解决办法。

o(TヘTo)

第六步:

最后一步啦,完成了上面的准备工作之后就要开始部署Java web项目啦!

在你的编译器中将项目导出为.war格式的文件放在共享盘中;若是有数据库的话,将你的数据库导出为.sql文件(需要的话记得连数据及结构导出)。还有,我的数据库刚安装好密码是空的,在导出.war文件之前注意连接数据库的语句里面的数据库名和密码,云服务器的数据库设置要和其保持一致。

在云服务器上把.war文件和.sql文件从共享盘里面复制出来放在合适的位置就可以啦。

.war文件要放在服务器下tomcat目录的webapps上,如下所示。

放到这里之后就会生成对应的项目文件夹(比如我的Found.war生成了Found文件夹)。如果没有生成不要着急,重启tomcat刷新界面试试,不会有太大的问题。

有数据库的话再导出从共享盘导出的.sql文件就好啦。

完成上述操作之后就可以在别的电脑上访问你的网页啦。

访问网址如下http://外网IP/Found/jiemian.jsp。

记得保持云服务器上的相关服务在运行状态,云服务器不需要“关机”。关闭远程连接窗口会有以下提示,保持tomcat以及你需要的服务在运行就可以了。

以上。

Guess you like

Origin www.cnblogs.com/ruangongyouxi/p/11069112.html