当前位置:网站首页>Web project deployment
Web project deployment
2022-06-24 10:32:00 【Ah Hui likes to sleep】
Our project , After all, it should be deployed to the server , Will have the sense of accomplishment of ending the flower scattering ;
How to deploy to Linux Server for , Realize the real browser website to visit you ?
1. To have a Cloud server
Alibaba cloud , Tencent, cloud, etc.
2. preparation
Preparing the deployment environment
Both in root User down operation
download JDK
stay Linux Directly find corresponding jdk Version can
yum list | grep jdk
Install the corresponding version
yum install file name
download MYSql
install
- install mariadb service
# yum install -y mariadb-server
- install mariadb Command line client
# yum install -y mariadb
- install mariadb C library
# yum install -y mariadb-libs
- install mariadb Development kit
# yum install -y mariadb-devel
Change configuration
- change /etc/my.cnf.d/client.cnf file
[client] Add a line to configure default-character-set=utf8
- change /etc/my.cnf.d/mysql-clients.cnf file
[mysql] Add a line to configure default-character-set=utf8
- change /etc/my.cnf.d/server.cnf To configure
[mysqld] Add configuration below
collation-server = utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
sql-mode = TRADITIONAL
start-up
Start the service
# systemctl start mariadb
- Set the service to start automatically
# systemctl enable mariadb
- View service status
# systemctl status mariadb
Test connection
- Try connecting... Using the command line client
# mysql -uroot
download Tomcat
Tomcat stay yum Previous editions There is no need , You can search directly in the browser , Download zip , Decompression can be
tomcat Cross platform use
After installation , function
sh startup.sh
Observe for operation
ps aux | grep tomcat
0. What is deployment
Involved in the work " Environmental Science "
- development environment : A machine used by programmers to write code .
- Test environment : The tester tests the machine used by the program . It is usually a retired deployment machine .
- Production environment ( The online environment ): The machine used when the final project is released . High requirements for stability .
Install the program copy to the production environment , This process is called " Deploy ". Also called " go online ".
This process requires copying the corresponding .class Files and dependent resource files ( Various configuration files , html etc. )
Once the program is successfully deployed , Then this program can be accessed by thousands of ordinary users in the Internet .
let me put it another way , If the program has BUG, This BUG It will be seen by millions of users .
The deployment process is critical , It is the most important part of program development . In case of deployment problems , It is very likely to lead to serious accidents ( The server Not available or something ).
To prevent deployment errors , Generally, there are some automatic deployment tools in the company ( Such as Jenkins etc. ). At present, we first use the manual deployment method To complete the deployment .
1. Database tables
Follow the previous database creation script , Run on the server , Create the same table structure
mysql -u[ Database user name ] -p[ Database password ] < [ Database script ].sql
Or create... Manually , Copy and paste
2. pack
Put the previously marked war Put the package in the specified directory (Tomcat webapps)
XShell You can directly drag and drop in ( Enter ahead of time webapps Catalog )
If you can't drag and drop files , install
yum install lrsz
Be careful :
Before war package Run locally , Access local database , Now on ECs , Access cloud server
Make sure the database , The connection is correct (URL,IP, user name , password , Cloud server , There is a corresponding database )
3. Is to verify the access
Enter the correct... In the browser URL You can access your own projects
边栏推荐
猜你喜欢
Leetcode-223: rectangular area
机械臂速成小指南(二):机械臂的应用
2022 International Symposium on intelligent robots and systems (isoirs 2022)
Machine learning - principal component analysis (PCA)
Using pandas to read SQL server data table
Leetcode-2221: triangular sum of arrays
Leetcode-498: diagonal traversal
2022全网最全最细的jmeter接口测试教程以及接口测试流程详解— JMeter测试计划元件(线程<用户>)
Thread pool execution process
4.分类管理业务开发
随机推荐
Learn to use PHP to implement unlimited comments and unlimited to secondary comments solutions
88.合并有序数组
Leetcode-2221: triangular sum of arrays
How to customize sharing links in wechat for H5 web pages
2022年智能机器人与系统国际研讨会(ISoIRS 2022)
International Symposium on energy and environmental engineering in 2022 (coeee 2022)
[IEEE publication] 2022 International Conference on intelligent transportation and future travel (cstfm 2022)
[resource sharing] the 5th International Conference on civil, architectural and environmental engineering in 2022 (iccaee 2022)
5. dish management business development
numpy.logical_or
【数据分析数据源】全国各省市行政区坐标(包含边界坐标点和中心坐标点)
SSM整合
Leetcode interview question 16.06: minimum difference
【Energy Reports期刊发表】2022年能源与环境工程国际会议(CFEEE 2022)
np.float32()
分布式事务原理以及解决分布式事务方案
Learning to organize using kindeditor rich text editor in PHP
A method to solve the self-adaptive width and height of the internal picture of rich text label in wechat applet
charles抓包工具使用教程
leetCode-929: 独特的电子邮件地址