Under java installation environment to build centos

1. Purchase server (Ali cloud)

2. reset the password, restart the server

3. Create an account work

groupadd work # Create Group
 mkdir / Data # Create a data folder 
the useradd -d / Data / work work -g - m # Create a work account and set the home work and home set
 the passwd work # Reset Password

 

4. Upload via FTP or scp jdk1.8 (because now the oracle does not allow anonymous download) and install

SCP JDK-8u74-Linux-x64.gz [email protected]: / Data / Software / 
the tar zxvf JDK-8u74-Linux-x64.gz # decompression
mv jdk1.8.0_74 / / opt / # to move / opt folder
ln -s /opt/jdk1.8.0_74/ jdk # set the link
vi / etc / profile # set environment variables

In the / etc / profile file append the following:

#JDK
export JAVA_HOME=/opt/jdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
export PATH JAVA_HOME CLASSPATH

After you save the changes to take effect the following command:

source /etc/profile

Whether the test configuration JDK success:

java -version

 

5. Download and install apache tomcat

cd / the Data / Software 
wget
HTTP: // mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.94/bin/apache-tomcat-7.0.94.tar.gz
tar zxvf
the Apache-Tomcat -7.0.94.tar.gz # decompression
mv apache-tomcat-7.0.94 / opt / # mobile
ln -s apache-tomcat-7.0.94 / apache-tomcat # set the link
# set the environment variable
vim / etc / profile # append the following phrase
export CATALINA_HOME = / opt / apache- tomcat

 

6. tenginx installation

cd / the Data / Software /
 wget  wget HTTP: // tengine.taobao.org/download/tengine-2.2.0.tar.gz # download tenginx 
tar zxvf tengine- 2.2 . 0 . tar .gz 
cd Tengine - 2.2 . 0 # switch to the folder tenginx
 yum  install PCRE- devel # install components
 yum  install openssl- devel # mount assembly 
. / the configure # configure nginx
 the make && the make  install 
# create a soft link 
LN -s / usr / local / nginx / / opt / Tengine 
# start nginx
/ opt / Tengine / sbin / nginx 
# nginx configuration file permissions (allow non-root account to start nginx)
cd / opt / Tengine / sbin /
chown root: root nginx
chmod 755 nginx
chmod + U the X-nginx
chmod + S nginx
 

Set nginx boot, add the following to the end of /etc/rc.local

su - work -c "/opt/tengine/sbin/nginx"

 

Guess you like

Origin www.cnblogs.com/mhl1003/p/10820003.html