英文:
How to install JCloud Server Application in my own VPS and service for developers
问题
当我拥有自己的Linux VPS服务器时,如何初始化软件环境并安装JCloud服务器应用程序以为开发人员提供服务。
英文:
When i have my own linux VPS Server , how can i initial software environment and install JCloud Server Application to service for developers.
答案1
得分: 1
1 : 检查服务器中的JDK版本
~$: java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
JDK版本应该是1.7或以上。
2: 确保服务器中安装了适当的J2EE容器(如Tomcat/WebLogic/Resin...)
Server version: Apache Tomcat/9.0.30
Server built: Jul 19 2020 21:45:54 UTC
Server number: 9.0.30.0
OS Name: Mac OS X
OS Version: 10.14.6
Architecture: x86_64
JVM Version: 1.8.0_221-b11
JVM Vendor: Oracle Corporation
~$:
我们使用Tomcat作为Web应用容器,您可以使用任何J2EE容器(Resin/WebLogic/GlassFish等)来托管WAR文件。
3: 在服务器中安装Mysql-Server
~$: mysql -ubigdog -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.27 MySQL Community Server (GPL)
...
在MYSQL中创建数据库:
CREATE DATABASE JCloudWeb;
注意:上述数据库名称应与您在编辑配置文件“WEB-INF/classes/conf/myconf.properties”时的“jdbc.url”属性相同。
在MYSQL中创建用户凭据:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
确保您的MYSQL-Server版本为5.7.27或更高。并在MYSQL中创建一个帐户,我们将在下一步中使用此帐户。作为开发人员,完成当前步骤后,您需要三件事:
- MYSQL主机IP地址/域名
- MYSQL帐户访问用户名
- MYSQL帐户访问密码
注意:您应该能够使用上述帐户凭据从运行JCloud Web应用程序的主机访问MYSQL服务器。
4: 下载JCloud服务器WAR文件
前往JCloud官方网站下载JCloud服务器WAR文件并部署到Tomcat。JCloud Server WAR文件名称格式为:JCloudServer_1.0.1.war
使用以下命令解压WAR文件:
jar xvf JCloudServer.war
或者
unzip JCloudServer.war
解压WAR文件后的目录结构如下:
JCloudServer$: ls
META-INF WEB-INF index.jsp res
JCloudServer$:
使用以下命令编辑数据库配置信息:
vim WEB-INF/classes/conf/myconf.properties
在myconf.properties中,您应该能够看到:jdbc.url、jdbc.user、jdbc.password,请为每个属性填入正确的值,这些值来自于第3步。
5: 配置server.xml
如果您使用的是Tomcat,则可以按如下配置;如果您使用其他J2EE容器,请正确配置您的服务器。
vim $TOMCAT/conf/server.xml
将以下配置添加到适当的位置:
<Context path="/" docBase="/opt/webapp/JCloudServer/"/>
其中docBase是JCloud Web应用的绝对目录,path是您希望将应用程序暴露给互联网的URI。
6: 启动Tomcat服务器以运行JCloud Server WAR文件
catalina.sh start
现在,通过访问http://localhost-ip-domain:port/,您应该能够看到JCloud Server的主页。您可以将访问域共享给开发人员,以便他们可以在您的JCloud服务器中注册自己的开发人员帐户。
开发人员在JCloud服务器中获取帐户后,可以下载JCloud SDK,根据JCloud框架开发基于本机/网络的应用程序。
这是有关如何使用JCloud SDK的链接:https://stackoverflow.com/questions/64037755
英文:
1 : Check JDK version in your server
~$: java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
JDK version should be 1.7 or above
2: Make sure you have proper J2EE container(tomcat/weblogic/resin..) installed in your server
Server version: Apache Tomcat/9.0.30
Server built: Jul 19 2020 21:45:54 UTC
Server number: 9.0.30.0
OS Name: Mac OS X
OS Version: 10.14.6
Architecture: x86_64
JVM Version: 1.8.0_221-b11
JVM Vendor: Oracle Corporation
~$:
we are using Tomcat as our web application container , You ca use any J2EE container(resin/webLogic/GlassFish...) to host the war file.
3: Install Mysql-Server in your server
~$: mysql -ubigdog -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, 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.
create database in MYSQL :
CREATE DATABASE JCloudWeb;
Note: The database name above should be as same as "jdbc.url" attribute in step 4 below when you edit config file "WEB-INF/classes/conf/myconf.properties"
Create user credential in MYSQL
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
Make sure your MYSQL-Server version is 5.7.27 or above. And create an account in mysql , we will use this account in next step. As a developer you need to have three thing when you finish current step:
1: MYSQL host IP address/Domain
2: MYSQL account access username
3: MYSQL account access password
Note: You should be able to access MYSQL Server from the host which is running JCloud web application using the account credential above.
4: download JCloud server war file
Go to JCloud official website to download JCloud server war file and deploy to tomcat. JCloud Server war file name format is:JCloudServer_1.0.1.war
unzip the war file using command below:
jar xvf JCloudServer.war
or
unzip JCloudServer.war
This is the directory structure once you extract war file:
JCloudServer$: ls
META-INF WEB-INF index.jsp res
JCloudServer$:
Edit database configuration information using command below:
vim WEB-INF/classes/conf/myconf.properties
in myconf.properties ,you should be able to see :jdbc.url,jdbc.user,jdbc.password, please fill correct value for each of them , you should get those values from step 3 above.
5: config server.xml
If you are using tomcat, then you can config as below, if you are using other J2EE container , please config your server correctly .
vim $TOMCAT/conf/server.xml
add the config below to proper postion
<Context path="/" docBase="/opt/webapp/JCloudServer/"/>
docBase is the absolute directory of JCloud web app , path is the URI which you want to expose your app to internet .
6: Start tomcat server to run JCloud Server war file
catalina.sh start
Now you should be able to see JCloud Server by accessing http://localhost-ip-domain:port/ to see home page , you can share the access domain to your developers so that they can register their own developer account in your JCloud server.
Once developers get the account in JCloud server, they can download JCloud SDK to develop native/web apps based on JCloud framework .
Here is the link about how to use JCloud SDK : https://stackoverflow.com/questions/64037755
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论