安装Redis
mkdir /opt/Redis
cd /opt/Redis
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
tar -xzf redis-6.2.6.tar.gz
mkdir /usr/local/redis
mv redis-6.2.6/* /usr/local/redis/
cd /usr/local/redis/
make
src/redis-server # 服务启动成功
打开新窗口 测试
cd /usr/local/redis/
src/redis-cli
set hello "hello redis"
get hello
shutdown
exit
设置后台启动
vim redis.cong
daemonize yes
logfile "/opt/Redis/redis.log"
redis添加systemctl服务
chown -R redis.redis redis
vim /lib/systemd/system/redis.service
[Unit]
Description=Redis
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/src/redis-server /usr/local/redis/redis.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
wq
systemctl daemon-reload
systemctl start redis
systemctl status redis
systemctl enable redis
安装JDK
?
uname -a
https://www.oracle.com/java/technologies/javase/jdk12-archive-downloads.html
https://tomcat.apache.org/download-90.cgi
mkdir /opt/Jdk
cd /opt/Jdk
rz -E
--------
tar -zxvf jdk-12.0.2_linux-x64_bin.tar.gz
jdk-12.0.2/bin/jlink --module-path jmods --add-modules java.desktop --output jdk-12.0.2/jre
-------
tar -xzvf jdk-8u321-linux-x64.tar.gz
vim /etc/profile
export JAVA_HOME JRE_HOME PATH CLASSPATH
export JAVA_HOME=/opt/Jdk/jdk1.8.0_321 #jdk安装目录
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export JAVA_PATH=$JAVA_HOME/bin:$JRE_HOME/bin
export PATH=$PATH:$JAVA_PATH
export PATH
source /etc/profile
java -version
安装tomcat
https://tomcat.apache.org/download-90.cgi
mkdir /opt/Tomcat
cd /opt/Tomcat
rz -E
tar -xzvf apache-tomcat-9.0.58.tar.gz
mv apache-tomcat-9.0.58 tomcat9
vim /etc/profile
export PATH=$PATH:/opt/Tomcat/tomcat9 #tomcat安装目录
export PATH
source /etc/profile
tomcat9/bin/startup.sh
netstat -nalp|grep 8080
tomcat9/bin/shutdown.sh
redis添加systemctl服务
vim /lib/systemd/system/tomcat.service
[Unit]
Description=Apache Tomcat 9
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/Tomcat/tomcat9/bin/startup.sh
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/opt/Tomcat/tomcat9/bin/shutdown.sh
PrivateTmp=true
[Install]
WantedBy=multi-user.target
vim tomcat9/bin/catalina.sh
export JAVA_HOME=/opt/Jdk/jdk1.8.0_321
export JRE_HOME=$JAVA_HOME/jre
systemctl start tomcat.service
systemctl status tomcat.service
netstat -antp | grep tomcat
firewall-cmd --state
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
firewall-cmd --permanent --zone=public --list-ports
|