Linux install JAVA web environment

A: Installing jdk
 
1. Download
Because some oracle authentication mechanism, it is necessary to add some parameters in front of the oracle link to download something when
wget --no-check-certificate --no-cookie --header "Cookie: oraclelicense=accept-securebackup-cookie;"  http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
2. Run the command: rpm -ivh jdk-8u45-linux-x64.rpm installation
3. finished now installed java -version can see the version slightly
-----------------------------------------------------------------------------------------------------------------
II: Installation tomcat
1. tomcat's official website to download tar.gz archive, use the following command to extract
     tar -zxf apache-tomcat-8.0.15.tar.gz
2. Create a soft link (equivalent to a shortcut) to facilitate the implementation of tomcat start, stop, view the log
Creating links to start:       
 
Create a working directory links: ln -s /mnt/apache-tomcat-8.0.15/webapps tomcatwebapps
 
Create a log directory links: ln -s /mnt/apache-tomcat-8.0.15/logs/ tomcatlog
3. Start it, then see if the visit successful
View tomcat process command
ps -ef | grep tomcat
4. tomcat start to see the logs based soft connection created earlier, real-time refresh
tailf -n 300 tomcatlog/catalina.out
5. If access to the input ip: 8080 pages of words may be because a firewall is not turned off, tomcat firewall is enabled by default

CentOS 6:

Check firewall status: service iptables status
Turn off the firewall: service iptables stop
 

CentOS 7:

Use a firewall Firewall
Open port 8080
firewall-cmd --zone=public --add-port=8080/tcp --permanent
 
Restart the firewall
firewall-cmd --reload
 
The following modifications tomcat conf folder server.xml [enter the domain name / ip can directly access the project]
 
Revised to 80 ports
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

Modify the access domain

<Host name="你的域名" appBase="webapps" unpackWARs="true" autoDeploy="true">

Modify the access path can not enter the project name [direct access]

<Context path = "" docBase = "/ myApp" /> docBase property Fill in your project location is the absolute path that is the best ..... / webapps / myApp.

----------------------------------------------------------------------------------------------------------------------
Three: Installation mysql:
 

1. Download rpm warehouse

 
 

2. Run

 
  Intermediate to choose y / N
rpm -ivh mysql-******.rpm
yum install mysql-community-server   
centOS7 there may be issues that need to perform under
 
 yum remove mysql-libs
 
Yum install else that one can not be executed
 

3. Start mysql

 
Start the MySQL server with the following command:
shell> sudo service mysqld start

 

You can check the status of the MySQL server with the following command:
    
 shell> sudo service mysqld status

4. Get the initial password mysql

 
grep 'temporary password' /var/log/mysqld.log
 

5. Modify the mysql password after the initial login password password requirement sensitive alphanumeric complete

shell> mysql -uroot -p
mysql>  ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';    [password] Oh to be in quotes
View port after landing []:
show variables like 'port'
 

6. authorized to appoint IP in accordance with the specified user name and password to access the database

Executed after entering the mysql
 
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.110' IDENTIFIED BY 'mysql的密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;
 
 

Guess you like

Origin www.cnblogs.com/ning-blogs/p/12070383.html