Preparation before deploying the application to the server

XShell uploads files to the Linux server


1. Modify the basic configuration of Linux

1. Modify the hostname

vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=server1.itcast.cn

2. Modify the ip address

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.0.101

NETMASK=255.255.255.0

service network restart

3. Modify the mapping relationship between ip address and host name

vi /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.101 server1.itcast.cn

4. Turn off iptables and set it to start/not start

service iptables stop

chkconfig iptables on

chkconfig iptables off

2. Install JDK

1. Upload jdk-7u45-linux-x64.tar.gz to Linux

2. Unzip jdk to /usr/local directory

tar -zxvf jdk-7u45-linux-x64.tar.gz -C /usr/local/

3. Set the environment variables and append the relevant content at the end of the /etc/profile file

vi /etc/profile

export JAVA_HOME=/usr/local/jdk1.7.0_45

export PATH=$PATH:$JAVA_HOME/bin

4. Refresh environment variables

source /etc/profile

5. Test if the java command is available

java -version

3. Install Tomcat

1. Upload apache-tomcat-7.0.68.tar.gz to Linux

2. Unzip tomcat

tar -zxvf apache-tomcat-7.0.68.tar.gz -C /usr/local/

3. Start tomcat

/usr/local/apache-tomcat-7.0.68/bin/startup.sh

4. Check whether the tomcat process is started

jps

clip_image002

5. View the tomcat process port

netstat -anpt | grep 2465

6. Access tomcat through browser

http://192.168.0.101:8080/

clip_image004

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324936872&siteId=291194637