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

Centos6.x server configuration jdk+tomcat+mysql environment (jsp+mysql)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1jdk configuration

Since the link to the official website of jdk does not directly support wget, you can download jdk using the following method, where the jdk version is jdk1.8.0_91:

The copy code is as follows:

Wget-no-check-certificate-no-cookies-header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz

For other versions of jdk, you can also use this method. The specific method is as follows: find the corresponding jdk version in http://www.oracle.com/technetwork/java/javase/archive-139210.html, click agree to download, right-click to copy the corresponding download link, and put the above.. / 8u91MB b14hand. Can be partially replaced.

Use the command after download

Tar-zvxf jdk-8u91-linux-x64.tar.gz

Extract the jdk. Then open the environment variable file to configure the environment variable with the following command

Vim / etc/profile

Add at the end

Export JAVA_HOME= "your jdk Root" export PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Replace the above with your jdk root directory and exit vim with: wq. Then use the command source / etc/profile to make the configuration file take effect (don't forget this step).

Enter java-version in the terminal, output a similar result, and the table name jdk is configured successfully.

Of course, it is also possible and more convenient to download and install packages in rpm format directly.

2, tomcat configuration

Select a version of the tomcat download in the website http://tomcat.apache.org/, and be careful to select either the tar.gz format or the zip format in the core in binary distributions. Other versions, such as Deployer, are not valid runnable server versions.

After downloading, use the tar-zvxf command to extract it, and then add a line to / etc/profile as shown in 1

CATALINA_HOME= "your Tomcat Root"

It takes effect after using source / etc/profile.

Then use the cd command to enter the tomcat root directory / bin folder, and run the startup script using. / startup.sh. The following figure indicates that the tomcat configuration is successful.

Another way to view the tomcat console in real time: go to the logs directory of the tomcat root directory and run the command tail-f catalina.out

3. Install mysql

The mysql in the system default source is 5.1, and the version is lower. To install a newer version of mysql, use the following steps:

Enter the following command in the console to add the mysql source to the rpm source of the system

Wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpmyum localinstall mysql-community-release-el6-5.noarch.rpm

Then look at the section of mysql in the system source:

Yum repolist all | grep mysql

If you want to install the latest version 5.7, you can use the following command:

Yum-config-manager-disable mysql55-communityyum-config-manager-disable mysql56-communityyum-config-manager-enable mysql57-community-dmr

Install mysql using the following command:

Yum install mysql-community-server

Start the mysql service:

Service mysqld start

The first time it starts, mysql takes a few minutes to initialize the environment. During this process, mysql assigns a random password to root, which can be changed to its own password in the following ways:

Modify the configuration file / var/my.cnf by adding a line: skip-grant-tables. The function is not to load the permission verification table.

Then use the command mysql-u root-p to prompt for the password, enter directly and enter the mysql software directly, and use the command

UPDATE mysql.user SET Password = PASSWORD ('newpass') WHERE user =' root'

Change the password, change the red one above to your own password, and then execute

FLUSH PRIVILEGES

Effective. At this point, the password modification is complete. Finally, don't forget to remove the skip-grant-tables from the configuration file / var/my.cnf.

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

Servers

Wechat

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

12
Report