Install jdk, tomcat, mysql, redis under linux system

One, install jdk

1.rpm -qa | grep jdk to detect whether jdk is installed

2.rpm -e --nodeps the existing jdk name to be uninstalled

3.tar -zxvf jdk-7u71-linux-i586.tar.gz 解压jdk

4.mv jdk-7u71-linux-i58/ /usr/local/src/java/jdk1.7 Move to /usr/local/src/java directory and rename jdk1.7

5.vim /etc/profile configure environment variables

1.export JAVA_HOME=java installation location
2.export PATH=$JAVA_HOME/bin:$PATH

6.source /etc/profile is the configuration file takes effect

7. java -version test is successful

Second, install tomcat

1.tar -xvf apache-tomcat-7.0.57.tar.gz decompress tomcat

2.mv apache-tomcat-7.0.57 /usr/local/src/java/tomcat7 Move the decompressed tomcat to the /usr/local/src/java/tomcat7 directory

3.vim /etc/sysconfig/iptables configure firewall

4.-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT Set the port number vim edit

5.service iptables restart restart the firewall service

6. Whether the access to 192.168.150.129:8080 through other hosts is successful

Three, install mysql

1.rpm -qa |grep -i mysql View previous version

2.rpm -e --nodeps software name

3.rpm -ivh *.rpm installation switch /root/itheima/ directory

4.service mysql start to start the service

5./usr/bin/mysqladmin -u root password 'new-password' set the password

6.mysql -uroot -p123 is available locally, available inside the virtual machine

7. Set the port - other can access remote host access,
1.vim /etc/sysconfig/iptables set the firewall to open
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT set the port number vim editor

2. Restart the service service iptables restart

3. Modify permissions
mysql -uroot -p123
show databases; use mysql; show tables; desc user;
select host ,user,password from user;
create user 'root'@'%' identified by '123'; //Create a user, Set password
grant all on *.* to 'root'@'%' with grant option; // Grant all
flush privileges of 'root'@'%' to the specified user; // refresh permissions

Fourth, install redis

(Local installation
1. First import the *.rpm file in the dependencies folder into linux

2.rpm -iUvh *.rpm install gcc

)

1. Install the c environment compiled by redis, yum install gcc-c++

2. Import redis-3.0.7.tar.gz into linux

3. Unzip tar -zxvf redis-3.0.7.tar.gz

4. Enter the decompressed redis-3.0.7 file cd redis-3.0.7

5. Compile make ----- Hint: It's a good idea to run 'make test' ;)

6. Install make PREFIX=/usr/local/redis install
After successful installation, there are several executable files redis-benchmark, redis-check-aof, redis-check-dump, redis- cli etc.

7. Background mode: the port of redis is 6379
1. Go back to itheima to find the redis file
2. cp redis.conf /usr/local/redis/bin/ copy to bin
3. Enter cd /usr/local/redis/bin/
4 .vim redis.conf edit
5. Change daemonize no to yes
6. Specify the configuration file at startup./redis-server redis.conf
7. Start the client./redis-cli
8.ping return pong and you can operate
127.0. 0.1:6379> ping
PONG
127.0.0.1:6379> set name jack
OK
127.0.0.1:6379> get name
"jack"

9. Shut down redis
method one: ps -ef | grep -i redis kill -9 31475
method two: shutdown on the client

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324756967&siteId=291194637