Deploying Web Projects on Linux

        Recently, I was learning linux, and the project manager also asked me to try to deploy the web project developed on windows on linux. According to the information he gave me and the content found on the Internet, the integration is as follows:

 

One, install JDK.

1. Check if JDK has been installed:

        #rpm -qa|grep jdk (filter all installed rpm packages that contain the word "jdk", if it exists, it means it has been installed) or #java -version.

2. Uninstall JDK: #rpm -e jdk-1.7.0_67-fcs.i586. (Remove residual files: #rm -rf)

3. Install JDK:

        See if Linux is 32-bit or 64-bit, x86_64 is 64-bit, i686 is 32-bit - #uname -a.

        Download the corresponding jdk on the official website, create a folder /usr/java in the /usr directory of Linux, enter the directory, put the downloaded jdk installation file in /usr/java, and modify it to an executable file——# chmod 777 jdk-1.7.0_67-fcs.i586.

        Then execute the file to install - # rpm -ivh jdk-7u67-linux-i586.rpm.

4. Environment configuration:

        #nano /etc/profile or #vi /etc/profile , then add the following in it and save -

export JAVA_HOME=/usr/java/jdk1.7.0_67
export JAVA_BIN=/usr/java/jdk1.7.0_67/bin
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH

( There is a reason why the third line is written like that. When executing Java, the path we wrote will be executed first !)

5. Execute the configuration file to make it take effect:

        # . /etc/profile (note the space between the dot and /etc/profile!)

6. Finally test whether the JDK is installed successfully: #echo $JAVA_HOME

        #java -version。

 

Second, install Tomcat.

1. Put the Linux installation package of tomcat in the tomcat directory, and then use the command to complete the decompression:

        #tar -zxvf apache-tomcat-7.0.52.tar.gz

2. If you need to configure the jdk memory parameters of tomcat, in catalina.sh under the bin of tomcat, add the following line before the location cygwin=false:

        JAVA_OPTS="$JAVA_OPTS -server -XX:PermSize=128M -XX:MaxPermSize=512m" (then save and exit!)

 

3. Things to change when Windows projects are moved to Linux servers ( continuously added... )

1. The paths and path separators involved in the "upload and download" function in the project.

2. The path of the project log.

3. If you already have a JDK, perhaps its path in the environment variable is in front of your own JDK path, and tomcat will use the first one first . If you want to use your own instead, either put your own JDK path first (or just leave your own JDK), or specify a JDK for tomcat:

        Remove the JDK global variable settings. Under tomcat, open the catalina.sh file, select a blank space that is pleasing to the eye, and add the following statement - export JAVA_HOME="your JDK path"

4. If you want to try whether the Linxu server is connected to a specific database, you can enter the following command - telnet database IP

5. Sometimes shutdown.sh may not be able to close tomcat, so here we can kill the process to close tomcat:

        kill process ID

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326682941&siteId=291194637