yum安装

1
2
3
4
5
6
7
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
mv epel.repo epel.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

jdk安装

1
2
yum list java*
yum install -y java-1.8.0-openjdk.x86_64

docker安装

1
2
3
4
5
6
7
8
9
yum install -y docker
systemctl start docker
systemctl enable docker
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://slycxkzw.mirror.aliyuncs.com"]
}
systemctl daemon-reload
systemctl restart docker

mysql安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
wget https://dev.mysql.com/get/mysql80-community-release-el7-6.noarch.rpm
rpm -ivh mysql80-community-release-el7-6.noarch.rpm
yum repolist all | grep mysql
yum -y install yum-utils
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
yum repolist enabled | grep mysql
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql-community-server

# 启动
systemctl start mysqld
# 查看状态
systemctl status mysqld
# 开机自启动
systemctl enable mysqld
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p'!CrXw>?4VM:d'
alter user root@localhost identified by 'Zyron2023@mysql';
grant all privileges on *.* to root@'%' identified by 'Zyron2023@mysql' WITH GRANT OPTION;

maven安装

1
2
3
4
5
6
7
8
9
wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.tar.gz
tar -zxvf apache-maven-3.9.1-bin.tar.gz
vim /etc/profile
====
export MAVEN_HOME=/mnt/apache-maven-3.9.1
export PATH=$PATH:$MAVEN_HOME/bin
====
source /etc/profile
mvn -verison

redis安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
yum list redis
yum install redis
chkconfig redis on
vim /usr/lib/systemd/system/redis.service
systemctl enable redis
systemctl start redis
systemctl status redis
redis-cli ping
redis-cli -h 127.0.0.1 -a 44zYqaZ9G4Bnb4Ed
redis-cli -h 47.98.164.224 -a 44zYqaZ9G4Bnb4Ed
Redis官网:https://redis.io/download
wget -O redis-6.2.12.tar.gz https://download.redis.io/releases/redis-6.2.12.tar.gz?_gl=1*gheb8z*_ga*NTc2MDM0NDU1LjE2ODExMDM4Njk.*_ga_8BKGRQKRPV*MTY4MzcwMTAzMi4yLjEuMTY4MzcwMTQ1OS42MC4wLjA.
tar -zvxf redis-6.2.12.tar.gz
cd redis-6.2.12
make
make PREFIX=/mnt/redis-6.2.12 install
./bin/redis-server& ./redis.conf

svn安装

1
2
3
4
5
6
yum -y install subversion
mkdir -p /usr/local/svn/svnrepos
#设置开机自启
vim /etc/sysconfig/svnserve
systemctl enable svnserve.service
systemctl start svnserve.service

ftp安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#安装
yum -y install vsftpd
yum -y install ftp
#开机启动,启动
systemctl enable vsftpd.service
systemctl start vsftpd.service
#配置属性调整:chroot_list_enable/chroot_list_file
vim /etc/vsftpd/vsftpd.conf
#关闭防火墙
systemctl stop firewalld
#创建用户。有问题可以删了重建:userdel -r ftpadmin
useradd -d /mnt/ftp -s /bin/bash -g ftp -G root ftpadmin
passwd ftpadmin
#用户提权
chown ftpadmin /mnt/ftp
#添加用户到白名单
vim /etc/vsftpd/chroot_list
#重启服务
systemctl restart vsftpd.service

gitlab安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
################
######非必要#####
#防火墙开启http、https、ssh访问
yum install -y curl policycoreutils-python openssh-server perl
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
#使用postfix发送邮件
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
#选择“Internet Site”
#“mail name”设置为您服务器的外部 DNS 域名
#SMTP配置:https://gitlab.cn/docs/omnibus/settings/smtp.html
######非必要#####
################
#配置GitLab软件源镜像
curl -L get.gitlab.cn | bash
#安装
EXTERNAL_URL="http://121.40.130.242" yum install -y gitlab-jh
#安装方法:https://gitlab.cn/docs/jh/install/install_methods.html
#获取初始密码:
cat /etc/gitlab/initial_root_password
#修改访问地址:external_url
vim /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure

nginx yum安装

1
2
3
yum install -y nginx
systemctl enable nginx
systemctl start nginx

nginx普通安装

1
2
3
4
5
6
7
8
9
10
yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
#随便找个目录存安装包
cd /mnt/
wget https://nginx.org/download/nginx-1.26.2.tar.gz
tar -zxf nginx-1.26.2.tar.gz
cd nginx-1.26.2/
#无需声明,会自动安装到/usr/local/nginx
./configure
make&&make install
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

node安装

1
2
3
4
5
6
git clone https://gitee.com/mirrors/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
sh -c 'echo ". ~/.nvm/nvm.sh" >> /etc/profile'
source /etc/profile
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node
nvm install v18.18.2
npm install -g cnpm --registry=https://registry.npmmirror.com

其他软件安装

1
2
3
4
5
6
yum install -y lrzsz
yum install -y git
yum install -y glances
yum install -y telnet
yum install -y supervisor
systemctl start supervisord