centos7.6 命令集锦

下面给大家介绍centos7.6 安装Tomcat-8.5.39的方法,具体内容如下所示:

 

#关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld
setenforce 0
sed -i '/SELINUX=/ s/enforcing/disabled/' /etc/selinux/config

#linux 更新yum源 改成阿里云源
yum install wget vim -y
#mkdir -pv /etc/yum.repos.d/bak
#mv -if /etc/yum.repos.d/* /etc/yum.repos.d/bak
#a=`cat /etc/redhat-release |awk '{print $4}'|awk -F . '{print $1}'`
#if [ $a == 6 ];then
#  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
#else
#  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#fi
#yum clean all
#yum makecache
#yum update

#装机必备
yum install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel tar unzip zip autoconf libtool make -y

#安装JDK
yum remove -y java*.x86_64
yum -y remove java-1.7.0-openjdk* 
yum -y remove java-1.8.0-openjdk*
yum install java-1.8.0-openjdk* -y
java -version
javac -version

#安装Tomcat
tar -xzvf /opt/soft/apache-tomcat-8.5.39.tar.gz -C /usr/local/
mv -f /usr/local/apache-tomcat-8.5.39 /usr/local/tomcat8.5.39
chmod 777 /usr/local/tomcat8.5.39/bin/*.sh
cp /opt/soft/tomcat /etc/init.d/
chmod 755 /etc/init.d/tomcat
/etc/init.d/tomcat restart
chkconfig --add tomcat
chkconfig tomcat on/systemctl enable tomcat/systemctl disable tomcat
相关参考:https://blog.csdn.net/capecape/article/details/78505511

Tomcat启停脚本

#!/bin/bash
# description: Tomcat7 Start Stop Restart
# processname: tomcat7
# chkconfig: 234 20 80

CATALINA_HOME=/usr/local/tomcat8.5.39

case $1 in
  start)
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  stop)
    ps -e|grep java|awk '{print "kill -9 "$1}'|sh
    # sh $CATALINA_HOME/bin/shutdown.sh
    ;;
  restart)
    ps -e|grep java|awk '{print "kill -9 "$1}'|sh
    sleep 3
    # sh $CATALINA_HOME/bin/shutdown.sh
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  *)
    echo 'please use : tomcat {start | stop | restart}'
  ;;
esac
exit 0

总结

以上所述是小编给大家介绍的centos7.6 安装Tomcat-8.5.39的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对ZaLou.Cn网站的支持! 如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

 

Redis教程
1、下载redis,地址: http://download.redis.io/releases/redis-5.0.4.tar.gz

2、安装gcc等默认需要的

yum install -y gcc tcl
复制
3、解压安装

# tar xzf redis-5.0.4.tar.gz
# cd redis-5.0.4
# make install
复制
4、修改redis.conf

bind 0.0.0.0 #允许远程
protected-mode no #关闭保护模式
daemonize yes #守护进程模式开启
复制
5、启动redis

# cd src
# ./redis-server ./../redis.conf

 

 

防火墙开启 :

centos 7对外开启80端口

root权限
firewall-cmd --zone=public --add-port=80/tcp --permanent  
命令含义:
--zone #作用域
--add-port=80/tcp  #添加端口,格式为:端口/通讯协议
--permanent   #永久生效,没有此参数重启后失效

重启防火墙:
systemctl stop firewalld.service  
systemctl start firewalld.service 
或:
firewall-cmd  --reload

查看已经开放的端口:
firewall-cmd --zone=public --list-ports

 chown -R mongod:mongod /var/log/mongdb

chown -R user:root /home/user

netstat -tlnp查看端口

 

查看要安装的版本:

rpm -ivh gitlab-ee-15.0.2-ee.0.el7.x86_64.rpm

yum install -y curl policycoreutils-python openssh-server cronie跳过/  curl -sS https://gitlab/gitlab-ce/script.rpm.sh | sudo bash

lokkit -s http -s ssh/yum install postfix service postfix start/ chkconfig postfix on 跳过

yum list gitlab-ee --showduplicates | sort -r

vim /etc/gitlab/gitlab.rb

修改这一行如下:

external_url 'http://localhost:8080'

再修改:

  --- /opt/gitlab/embedded/service/gitlab-rails/ee/app/models/license.rb
  +++ /opt/gitlab/embedded/service/gitlab-rails/ee/app/models/license.rb
  @@ -367,7 +367,7 @@
  end

  def plan
  -    restricted_attr(:plan).presence || STARTER_PLAN
  +    restricted_attr(:plan).presence || ULTIMATE_PLAN
  end

  def edition

改这行:

restricted_attr(:plan).presence || STARTER_PLAN

gitlab-ctl reconfigure重启配置 这样就可以了
gitlab-ctl restart重启服务

 

修改IP

ip addr
cd /etc/sysconfig/network-scripts
vim ifcfg-ens33

添加:
IPADDR=192.168.1.12
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
DNS1=192.168.1.1
service network restart

 

关闭SELINUX并重启系统

vi /etc/sysconfig/selinux

SELINUX=disabled

reboot重启

getenforce/Disabled

 

which pip3.6查看版本

ln -s /user/local/bin/pip3.6 /usr/local/bin/pip

pip install virtualenv 安装虚拟机

posted on 2022-10-10 09:01  王飞侠  阅读(83)  评论(0编辑  收藏  举报

导航