2022年4月25日星期一

Ubuntu 20.04 搭建Discuz论坛

 sudo apt install apache2 mysql-server php php-mysql php-xml -y

git clone https://gitee.com/3dming/DiscuzL.git cp -a DiscuzL/upload/* /var/www/html/ vi /etc/mysql/mysql.conf.d/mysqld.cnf mysql -u root -p create database discuz; create user Soar@'%' identified by 'Soar1233456'; GRANT ALL ON *.* TO 'Soar'@'%'; FLUSH PRIVILEGES; exit; systemctl restart apache2

2022年4月24日星期日

mysql 配置密码

 sed -i 's/bind-address/#bind-address/g' /etc/mysql/mysql.conf.d/mysqld.cnf mysql -u root -p create user root@'%' identified by 'Soar123456!'; FLUSH PRIVILEGES; exit;

CentOS搭建Discuz论坛

 Discuz 是基于PHP网页,在 Linux 和 windows 两平台均可部署的

论坛工具。

准备LAMP环境

安装MySQL

# 下载安装repo源
[root@localhost ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# 安装
[root@localhost ~]# yum -y install mysql-server
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# chkconfig mysqld on
设置mysql登录密码
[root@localhost ~]# mysqladmin -uroot password '123.com'

安装Apache组件

[root@localhost ~]# yum -y install httpd
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd

安装PHP

[root@localhost ~]# yum install php php-fpm php-mysql -y
[root@localhost ~]# vim /etc/php.ini
short_open_tag = On
[root@localhost ~]# systemctl start php-fpm 
[root@localhost ~]# systemctl enable php-fpm

安装配置Discuz

下载Discuz

[root@localhost ~]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip

解压部署

[root@localhost ~]# unzip Discuz_X3.2_SC_UTF8.zip
[root@localhost ~]# cp -r upload/* /var/www/html/
[root@localhost ~]# chmod -R 777 /var/www/html
[root@localhost ~]# cd /var/www/html/config
[root@localhost config]# cp config_global_default.php config_global.php 
[root@localhost config]# cp config_ucenter_default.php config_ucenter.php 
[root@localhost ~]# systemctl restart httpd

访问http://192.168.1.14/install

按照步骤安装完成即可

CentOS部署Jumpserver堡垒机

 硬件要求4G内存,双核cpu

cd /opt
yum -y install wget git
git clone --depth=1 https://github.com/jumpserver/setuptools.git
cd setuptools
cp config_example.conf config.conf
./jmsctl.sh install

访问http://192.168.1.14

CentOS使用yum安装MySQL5.7报检索密钥错误解决方法

 使用yum安装MySQL时报错

yum -y install mysql mysql-server
yum -y install mysql-community-server 
报错内容如下

warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
源 "MySQL 5.7 Community Server" 的 GPG 密钥已安装,但是不适用于此软件包。请检查源的公钥 URL 是否配置正确。
失败的软件包是:mysql-community-libs-compat-5.7.37-1.el7.x86_64
GPG  密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

处理方式有两种

  1. 到mysql官网下载校验文件
  2. 修改配置跳过校验
    本文记录第二种方式
    编辑文件
    /etc/yum.repos.d/mysql-community.repo
    修改对应安装版本的gpgcheck=0即可,默认值为1
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
再次安装即可

CentOS7安装完成后没有网络

 sed -i 's/ONBOOT=no/ONBOOT=yes/g' /etc/sysconfig/network-scripts/ifcfg-ens33

输入命令:systemctl restart network


2022年4月17日星期日

docker 安装 vim

 docker exec -it mysql bash

mv /etc/apt/sources.list /etc/apt/sources.list.bak

echo “deb http://mirrors.163.com/debian/ jessie main non-free contrib” >> /etc/apt/sources.list

echo “deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >>/etc/apt/sources.list

echo “deb-src http://mirrors.163.com/debian/ jessie main non-free contrib” >>/etc/apt/sources.list

echo “deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib” >>/etc/apt/sources.list

echo “deb http://mirrors.163.com/debian/ buster main” >> /etc/apt/sources.list

echo “deb http://mirrors.163.com/debian/debian-security buster/updates main” >>/etc/apt/sources.list echo “deb-src http://mirrors.163.com/debian/ buster-updates main” >>/etc/apt/sources.list

deb http://deb.debian.org/debian buster main

deb http://security.debian.org/debian-security buster/updates main

deb http://deb.debian.org/debian buster-updates main

sed -i ‘s/deb.debian.org/mirrors.163.com/g’ /etc/apt/sources.list

sed -i ‘s/security.debian.org/mirrors.163.com/g’ /etc/apt/sources.list

apt-get update -y

apt-get install vim -y

apt-get install wget -y

apt-get install curl -y

apt-get install unzip -y

Ubuntu 20.04 搭建Discuz论坛

  sudo apt install apache2 mysql-server php php-mysql php-xml -y git clone https://gitee.com/3dming/DiscuzL.git cp -a DiscuzL/upload/* /var...