当前位置:网站首页>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
边栏推荐
- 静态链接库和动态链接库的区别
- The difference between static link library and dynamic link library
- 多线程的应用 - 提升效率
- Caching mechanism for wrapper types
- 机械臂速成小指南(三):机械臂的机械结构
- Image click enlargement and adaptive size in the applet rich text
- Difference between package type and basic type
- Web site development, lazy image loading
- 栈题目:函数的独占时间
- Distributed transaction principle and solution
猜你喜欢
6. package management business development
Illustration miscellaneous [for archiving to prevent loss]
线程池的执行流程
1. project environment construction
自定义kindeditor编辑器的工具栏,items即去除不必要的工具栏或者保留部分工具栏
SQL Server AVG function rounding
24. 图像拼接大作业
JMeter接口测试工具基础— 取样器sampler(二)
Uniapp implements the function of clicking to make a call
numpy. linspace()
随机推荐
Leetcode-223: rectangular area
Distributed transaction principle and solution
Leetcode-1089: replication zero
机械臂速成小指南(二):机械臂的应用
[EI分享] 2022年第六届船舶,海洋与海事工程国际会议(NAOME 2022)
The difference between the sleep () method and the wait () method of a thread
解决微信小程序rich-text富文本标签内部图片宽高自适应的方法
numpy. logical_ and()
Illustration miscellaneous [for archiving to prevent loss]
分布式事务原理以及解决分布式事务方案
The difference between static link library and dynamic link library
【资源分享】2022年环境工程与生物技术国际会议(CoEEB 2022)
2022 International Symposium on intelligent robots and systems (isoirs 2022)
1.项目环境搭建
Role of message queuing
【IEEE出版】2022年工业自动化,机器人与控制工程国际会议(IARCE 2022)
uniapp开发微信小程序,显示地图功能,且点击后打开高德或腾讯地图。
Leetcode-1051: height checker
3.员工的增删改查
numpy.logical_and()