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

How to configure jdk+tomcat+mysql environment for Centos server

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to configure the jdk+tomcat+mysql environment on the Centos server". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure the jdk+tomcat+mysql environment on the Centos server.

1jdk configuration

The copy code is as follows:

Wget-no-check-certificate-no-cookies-header "cookie: oraclelicense=accept-securebackup-cookie"

For other versions of jdk, you can also use this method. The specific method is as follows: after finding the corresponding jdk version, click agree to download, right-click to copy the corresponding download link, and put the above.. / 8u91Mub 14hand. 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.

Thank you for your reading, the above is the content of "how to configure the jdk+tomcat+mysql environment on the Centos server". After the study of this article, I believe you have a deeper understanding of how to configure the jdk+tomcat+mysql environment on the Centos server, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Development

Wechat

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

12
Report