Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy web Project in Linux system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to deploy the Linux system web project, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

Linux system deployment web project specific method to deploy an ordinary web project, first of all, to build a web server running environment on linux, you need to download the Linux system versions tomcat, jdk and mysql in advance. I downloaded the following versions:

JDK:jdk-8u181-linux-x64.tar.gz

JDK link: https://pan.baidu.com/s/1FUlpRB-e5fTXYmxHTLHi_w extraction code: ei4a

Tomcat:apache-tomcat-8.5.39.tar.gz

Tomcat link: https://pan.baidu.com/s/1XHUfgO-ZVMhG-7QyCFLzSQ extraction code: tevd

Mysql:mysql-5.7.24-1.el6.x86_64.rpm-bundle.tar

Mysql link: https://pan.baidu.com/s/168FfNkuP_zb-j56wSrRLtQ extraction code: y2e3

1. Install and configure JDK environment

1. Uninstall previous JDK,openJDk

View the existing jdk,java-version of the system

Uninstall:

Yum remove * openjdk

two。 Install your own jdk

Upload jdk from windows to linux (default will upload to the current download), but generally do not install it directly under root, so use the rz command to copy a copy of jdk to / usr/java/

Then create a folder java under / usr/:

Mkdir / usr/java

Then copy the jdk to this directory:

Cp / root/jdk-8u181-linux-x64.tar.gz / usr/java/

Change to the java directory to decompress:

Tar-xvf jdk-8u181-linux-x64.tar.gz

After the decompression is completed, the environment variables are configured:

Edit file: vim / etc/profile

Add the following at the end of the file:

Export JAVA_HOME=/usr/java/jdk1.8.0_181

Export PATH=JAVA_HOME/bin

Export CLASSPATH=.:$JAVA_HOME/lib

Export JAVA_HOME PATH CLASSPATH

After editing, press Esc to exit editing mode,: wq save and exit

Then execute the command: source / etc/profile (to make the modified file effective)

Last look at the jdk version: java-version

two。 Install tomcat (requires a jdk environment, so install jdk first) 1. Upload tomcat package

Then create a folder tomcat under / usr/:

Mkdir / usr/tomcat

Copy the tomcat to this directory and unzip it

Cp / root/apache-tomcat-8.5.39.tar.gz / usr/tomcat/

two。 Configure environment variables:

Edit a file

Edit file: vim / etc/profile

Combined with the previous JDK environment variable is as follows:

Export JAVA_HOME=/usr/java/jdk1.8.0_181

Export CATALINA_HOME=/usr/tomcat/apache-tomcat-8.5.39

Export PATH=JAVA_HOME/bin:$CATALINA_HOME/bin

Export CLASSPATH=.:CATALINA_HOME/lib

Export JAVA_HOME PATH CLASSPATH CATALINA_HOME

Save and exit

3. Start tomcat

Enter the directory: cd / usr/tomcat/apache-tomcat-8.5.39/bin

Direct execution: startup.sh script startup

You can check the startup log above to see if there are any errors reported, and then access tomcat in the browser. If you can access "http://localhost:8080"", you will have no problem popping up the home page of tomcat.

Check the tomcat version:. / version.sh

Close tomcat:shutdown.sh

After running tomcat, access it in the browser of the windows system, and install OK when the following page appears:

three。 Install Mysql before installing Mysql, clean up other previously installed versions of Mysql. If you haven't installed it before, continue all the way west.

1. Upload the Mysql installation package and extract it

two。 Install 5 Mysql installation packages through the rpm command in turn. If the installation fails, try to add the "- force-nodeps" command to install.

3. After installation, start Mysql:sudo service mysqld start

4. Change the login password of Mysql and enter instructions to obtain the default password for installing root: grep 'temporary password' / var/log/mysqld.log

5. Log in again with the root default password to change the password: mysql-uroot-p

6. Change the password: set PASSWORD = PASSWORD ('password')

7. View the Mysql database: show databases

four。 Deploy web project 1. Project packaging

Package the developed web project into a war package, and change the IP of config.json under the front package static.

two。 Upload the war package to (it is convenient to upload it with the Xftp tool: https://www.cnblogs.com/taojietaoge/p/10685890.html)

Under the / usr/tomcat/apache-tomcat-8.5.39/webapps directory, tomcat will decompress automatically

3. Create database and execute mysql script

Enter mysql, create the database of web project, send the script of building database and table of Mysql, etc.

4. Then execute the script of building the Mysql database and table of the web project.

5. View the execution results of the script

After Finally has finished all the above steps, open the browser to visit the project and OK it.

Besides:

In addition, there is an easier way to deploy the Web project on Linux. Change to a Linux system and install the software, namely OK, normally, as shown below:

The above is all the contents of the article "how to deploy the web project in the Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report