Centos7安装常用工具

好久没玩了,回归啦,更新一下我有道云笔记的杂乱笔记。后续会持续更新,觉得整理的不错就给个赞呗。感谢你的浏览,希望对你有帮助!

安装nginx


yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

wget http://nginx.org/download/nginx-1.16.1.tar.gz

tar -zxvf nginx-1.16.1.tar.gz
cd nginx-1.16.1

./configure
make
make install

/usr/local/nginx/

cd /usr/local/nginx/sbin
./nginx







cd /usr/local/nginx/sbin/
./nginx -s reload


安装jdk


jdk官网下载地址



tar -zxvf jdk-8u261-linux-x64.tar.gz

mv jdk-8u261-linux-x64 jdk

vim /etc/profile

JAVA_HOME=/usr/local/jdk
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH

:wq

source /etc/profile


java
javac
java -version

安装MySQL

#下载mysql的Yum仓库
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

yum -y install mysql57-community-release-el7-10.noarch.rpm

#安装 mysql服务
yum -y install mysql-community-server

#启动数据库服务, systemctl 该命令可用于查看系统状态和管理系统及服务,centos7上开始使用
systemctl start  mysqld.service

#查看状态
systemctl status mysqld.service

#在日志文件中查看初始密码
grep "password" /var/log/mysqld.log

#进入修改Mysql密码

mysql -uroot -p

#新密码设置必须由大小写字母、数字和特殊符号组成
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123456';

#开启mysql的远程访问, %是指全部
grant all privileges on *.* to 'root'@'%' identified by 'root123456' with grant option;

#刷新权限
flush privileges; 


安装redis


yum install -y gcc

wget http://download.redis.io/releases/redis-5.0.5.tar.gz

tar -zxvf redis-5.0.5.tar.gz

cd redis-5.0.5
make

make install PREFIX=/usr/local/redis


cd /usr/local/redis/bin/
./redis-server


cp /usr/local/redis-5.0.5/redis.conf /usr/local/redis/bin/
cd redis/bin/
vi redis.conf




./redis-server /usr/local/redis/bin/redis.conf



cd /usr/local
rm -rf redis-5.0.5
rm -rf redis-5.0.5.tar.gz

安装maven

cd /usr/local

wget https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz

tar -xvf apache-maven-3.6.1-bin.tar.gz

mv apache-maven-3.6.1 maven


vim /etc/profile
export PATH=/usr/local/maven/bin:$PATH
source /etc/profile

mvn -V

安装docker


sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
                  

sudo yum install -y yum-utils

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
    

sudo yum install docker-ce docker-ce-cli containerd.io


sudo systemctl start docker


sudo systemctl enable docker


sudo docker run hello-world



sudo mkdir -p /etc/docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://9w9zqgnf.mirror.aliyuncs.com"]
}
EOF

sudo systemctl daemon-reload

sudo systemctl restart docker





docker images

docker ps

docker ps -a

docker update  --restart=always

docker rmi 

Error response from daemon: conflict: unable to delete 55622bd39160 (must be forced) - image is referenced in multiple repositories
请使用下面命令(加-f强制删除)
docker rmi -f 

先   docker ps -a   
找到 CONTAINER ID
docker start 

systemctl restart docker

安装nacos

nacos下载地址


tar -zxvf nacos-server-1.3.2.tar.gz 
cd /usr/local/nacos/bin/
nohup sh startup.sh -m standalone &

一些常用的命令


systemctl start firewalld

systemctl stop firewalld

systemctl status firewalld 

firewall-cmd --zone=public --add-port=80/tcp --permanent 

firewall-cmd --reload

firewall-cmd --zone=public --list-ports

lsof -i :端口号

kill -9 进程号

find / -name *tomcat*

nohup java -jar dubbo-admin-server-0.2.0.jar >dubbo-admin.log &

你可能感兴趣的:(Centos7安装常用工具)