1、jdk1.8 检查 yum 中有没有 java1.8 包
yum list java-1.8*
开始安装
yum install java-1.8.0-openjdk* -y
2、安装redis https://www.cnblogs.com/hjw-zq/p/9778514.html
yum install redis
yum install epel-release
systemctl start redis
systemctl status redis
自启动
systemctl enable redis
安装数据库
1、安装RPM
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2、安装客户端
yum install postgresql11
3、安装依赖包
yum install postgresql11-libs
yum install postgresql11-contrib
yum install postgresql11-devel
4、安装服务器端
yum install postgresql11-server
5、数据初始化与启动
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemctl start postgresql-11
6、修改密码
passwd postgres
上面的方法无法安装的时候使用下面这种
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
rpm -qi pgdg-redhat-repo
sudo dnf module disable postgresql
sudo dnf clean all
sudo dnf -y install postgresql11-server postgresql11
dnf info postgresql11-server postgresql11
修改可访问配置
vim /var/lib/pgsql/11/data/postgresql.conf
listen_addresses = ‘*’
port = 5432
vim /var/lib/pgsql/11/data/pg_hba.conf
host all all 0.0.0.0/0 md5
systemctl restart postgresql-11
安装nginx
sudo yum install nginx
sudo systemctl enable nginx
sudo systemctl start nginx
脚本自启动
方法一:
chmod +x /etc/rc.d/init.d/yourService
cd /etc/rc.d/init.d
chkconfig --add yourService.sh
chkconfig yourService.sh on
方法二:(此方法可以正常开机执行,且不会每次登录都执行,推荐)
自己写的脚本:yourService.sh
vim /etc/init.d/yourService.sh
chmod +x /etc/init.d/yourService.sh
chkconfig --add yourService.sh
chkconfig yourService.sh on
网友评论