当前位置:网站首页>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
边栏推荐
猜你喜欢

uniapp 开发微信公众号,下拉框默认选中列表第一个

How to customize sharing links in wechat for H5 web pages

机械臂速成小指南(一):机械臂发展概况

Leetcode-2221: triangular sum of arrays

【Energy Reports期刊发表】2022年能源与环境工程国际会议(CFEEE 2022)

4.分类管理业务开发

Machine learning - principal component analysis (PCA)

分布式系统你必须了解的点-CAP

Uniapp develops wechat official account, and the drop-down box selects the first one in the list by default

使用swiper左右轮播切换时,Swiper Animate的动画失效,怎么解决?
随机推荐
Cross domain overview, simple accumulation
JMeter接口测试工具基础— 使用Badboy录制JMeter脚本
JMeter接口测试工具基础 — Badboy工具
3. addition, deletion, modification and query of employees
JMeter interface test tool foundation - sampler (II)
Safety and food security for teachers and students of the trapped Yingxi middle school
使用swiper左右轮播切换时,Swiper Animate的动画失效,怎么解决?
JMeter接口测试工具基础— 取样器sampler(二)
分布式系统你必须了解的点-CAP
牛客-TOP101-BM28
Customize the toolbars of the kindeditor editor. Items removes unnecessary toolbars or retains some toolbars
numpy. linspace()
Web site development, lazy image loading
多线程的应用 - 提升效率
Six states of threads
SSM integration
6. package management business development
HBuilder制作英雄皮肤抽奖小游戏
【资源分享】2022年第五届土木,建筑与环境工程国际会议(ICCAEE 2022)
用扫描的方法分发书稿校样