Build Tomcat + mysql + jdk environment Linux environment

Reprinted from: https://www.cnblogs.com/liulinghua90/

Explanation

After testing environment is the development environment, the development environment is the development and deployment of general, while developing a specific output will deploy manuals, installation guides.

Test engineers need to build a manual test based on the deployment environment, you can find difficult to help develop, test needs to know linux system, familiar with common command, independent installation configuration tomcat, database on it.

 

That is, all the required software installed on the server, so that you can use to test the object, which is to build a test environment,
For example, you want to build a web end, usually need to install jdk, and then install the database, and then install an application server, to deploy your project to the container, so that a web server test environment build better.

Link: https: //www.zhihu.com/question/334878740/answer/749870577

[I] ------ Linux environment to build a 64-bit version of linux systems centos

1. Download and install a VMware workstation, this is a virtual machine platform behind to build a Linux system inside.

 

2. Download a centos installation package, there are several versions of linux, such as redhat, ubuntu, deepin, BT3, personally accustomed to using centos, here to download a CentOS-6.4-i386-bin-DVD1.iso, 6.4 version.

 

3. Create a new virtual machine and install this package import into, and remember that there are steps during the step is needed to build and set up a user password, user account here is the ordinary linux environment, but the root account password is the root and ordinary users common passwords

 

4. After installation, a graphical interface, in general we have to use the command-line interface, it can be used where the shortcut keys CTRL + ALT + F2, it can switch to the command interface.

 

5. ifconfig commands like IP address, and can be considered to connect with Xshell virtual machine, this operation command will be more convenient, without frequent switching out or switched out.

[JDK installation]

1. First, download a JDK version, the official website address: oracle.com/technetwork/

Download the 1.8 version , I marked out with a red box:

Perhaps some students did not see the version 1.8, you can easily download a linux version can of! Must remember is linux version! ! Many students made a mistake, direct download windows version!

2. After local decompression with xftp uploaded to the linux environment. Upload path: / usr / local

3. given the highest authority JDK file , or have permission to use or reference questions clog your operation (remember to connect your xshell behind

, Is this tool, there is a problem, you can look at how Baidu links to your linux server), detailed steps are as follows:

1) switching to top-level directory cd ~

2) then switch to the parent directory cd ..

3) switch to cd / usr the local path / local

4) gives the highest JDK file permissions chmod 777 -R jdk1.8.0_65

 

4. Configuration JDK environment variables:

1) switching to top-level directory cd ~

2) switching to the parent directory cd ..

cd etc 3) is switched to the path etc

4) Edit profile file vi profile

5) i press the keyboard key to enter edit mode, has been positioned to the end of the document [profile remember it is to you to the end of the document, you should not delete the document! ]!

6) arranged JDK environment variables, input profile in the following :

export JAVA_HOME = / usr / local / jdk1.8.0_65 [Special Note: This is the path to your jdk installation of! ! ! Do not mistake! To prevail on your own path! ]

[Emphasis! Many students after decompression, the wrong place, remember that you upload up JDK open interface should look like this! Until this interface is the location of your JDK environment variable! After opening the path to ensure /usr/local/jdk1.8.0_65 is my screenshot below interface! ! ! ! ]

 

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

7) Hold down the keyboard ESC key, and then enter: wq, on the preservation of the environment variables you just set

8) let you just set environment variables to take effect source profile

9) How to view your JDK is configured to complete it? Enter the command java -version, see instructions JDK version of the screenshot below, it means you configure a success!

【Tomcat】

1. First, download a tomcat version, here it is my apache-tomcat-6.0.35 version, apache-tomcat-6.0.35.zip is the corresponding archive and decompress it in your native;

2. can directly already unpacked apache-tomcat-6.0.35 with XFTP upload it to / usr / local path , uploaded, and then here you need to configure your environment variables, and then back tomcat will smooth start

3. Press the steps to start tomcat:

1) switching to top-level directory cd ~

2) switching to the parent directory cd ..

3) switch to start command bin path where: cd /usr/local/apache-tomcat-6.0.37/bin

4) Enter the command to start tomcat ./startup.sh , if you encounter the following tips, it shows you the command of the bin file inside the operating authority is not enough, we need to give permission:

 

 

5) Return to the parent directory bin cd ..

6) the highest authority given bin file chmod 777 -R bin

7) switch to the CD bin bin path

8) and then perform again tomcat startup command: ./startup.sh, appear the following screenshot, it indicates a successful start.

 

 

 

9) general default port is 8080, so enter your ip address plus port number directly on your computer's browser that can access the home page of the tomcat. http: // [your linux server IP address]: 8080

Note: ip ip address is the address of your Linux server, how to get? ---> Enter ifconfig in Linux you can get to!

10) but any configuration will not be so easy to configure success, it will turn off the firewall or port is occupied by the problem, where we can switch to the bin directory under tomcat , execute the following command to view the tomcat log: ./catalina. RUN SH , log format generally as follows:

 

 

 

Note: If you can not access, you can try to turn off the firewall, enter the command in Linux: service iptables stop, and then access it!

Turn off the firewall directly above command is not recommended, try the following method

Was added to the configuration file with the following command vim / etc / sysconfig / iptables last line, it may allow 80 port access

iptables -I input -p tcp --dport 80 –j accept

 

service iptables restart

11) In the browser enter the IP address plus port number, if you see tomcat home page, it indicates success, as follows:

 

 

[Mysql configuration]

1. Switch to the path you need to install mysql cd / usr / local

2. Online installation have a lot, we are here to build their own test environment, you can choose a direct -line installation , the following command: yum install MySQL-Server , has been waiting for it to complete the installation, some steps need to ask whether to continue during the direct input Y to

3. After the installation is complete, start mysql service, the command is: Service Start mysqld , see the following screenshot, then install mysql success

 

 

4. Usually this is the default installation mysql root to root login, password default to null, the input of the following command: mysql -p -u root , then press enter the password to log into the database. As follows:

 

 

It indicates that logged on to the database.

6, how to use local navicate connection linux server database? And operate the database:

1) First, to create a new user because general database users are linux native access, we want to access linux outside the database, it is necessary to create a user permissions for%
2) Log on to the database in xshell in: mysql -u root -p Enter then, when you want to enter a password, then enter you can log into, because the database default user is root, password is empty
3) switch to database use mysql mysql
4) Create a user can access a linux outside the database server: grant all privileges on * * to 'root' @ '%' identified by '123456' with grant option;.
5) Refresh permissions: flush privileges;
6) then navicate to log in just fine! Root user password is 123456 specifically how to use navicate connect to the database, your own Baidu!

Guess you like

Origin www.cnblogs.com/dashu123/p/11776213.html