Linux服务器apache2+PHP7环境配置

一、安装包下载与安装 1.安装apache2 sudo apt-get install apache2 2.安装PHP //-y的意思是全部默认选择yes //8条命令分8次输入 //1 sudo apt -y install software-properties-common apt-transport-https lsb-release ca-certificates //2 sudo add-apt-repository ppa:ondrej/php //3 sudo apt-get update //4 sudo apt install php7.2-fpm php7.2-mysql php7.2-curl php7.2-gd php7.2-mbstring php7.2-xml php7.2-xmlrpc php7.2-zip php7.2-opcache -y //5 sed -i ‘s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/’ /etc/php/7.2/fpm/php.ini //重启PHP //6 systemctl restart php7.2-fpm //7 sudo apt-get update //8 … Read more

IntelliJ IDEA 设置代码提示或自动补全的快捷键 (附IntelliJ IDEA常用快捷键)

IntelliJ IDEA 设置代码提示或自动补全的快捷键 (附IntelliJ IDEA常用快捷键) 修改方法如下: 点击 文件菜单(File) –> 点击 设置(Settings… Ctrl+Alt+S), –> 打开设置对话框。 在左侧的导航框中点击 KeyMap。 接着在右边的树型框中选择 Main menu –> Code –> Completion. 接着需要做两件事: 1. 移除原来的Cycle Expand Word 的 Alt+/ 快捷键绑定。 2. 在 Basic 上点击右键,去除原来的 Ctrl+空格 绑定,然后添加 Alt+/ 快捷键。 然后应用(Apply), OK. IntelliJ Idea 常用快捷键列表 Alt+回车 导入包,自动修正 Ctrl+N  查找类 Ctrl+Shift+N 查找文件 Ctrl+Alt+L  格式化代码 Ctrl+Alt+O 优化导入的类和包 Alt+Insert 生成代码(如get,set方法,构造函数等) … Read more

EMQX 安装(建议用docker运行,见另一文章)

下载地址(注意区分arm 和amd64): https://www.emqx.cn/downloads#broker 1. 下载 wget https://www.emqx.cn/downloads/broker/v4.3.0/emqx-centos8-4.3.0-amd64.rpm 2. 安装 sudo yum install emqx-centos8-4.3.0-amd64.rpm 3. 运行 sudo emqx start   打开浏览器输入:127.0.0.1:18083 默认账户:admin 密码:public   客户端连接,端口默认1883   协议 mqtt  默认账户:admin 密码:public  

kafka install

This tutorial assumes you are starting fresh and have no existing Kafka or ZooKeeper data. Since Kafka console scripts are different for Unix-based and Windows platforms, on Windows platforms use bin\windows\ instead of bin/, and change the script extension to .bat. Step 1: Download the code Download the 1.1.0 release and un-tar it. > wget http://mirrors.hust.edu.cn/apache/kafka/1.1.0/kafka_2.11-1.1.0.tgz > tar -xzf kafka_2.11-1.1.0.tgz > cd kafka_2.11-1.1.0 Step 2: … Read more

kafka 安装入门

kafka正常运行,必须配置zookeeper,否则无论是kafka集群还是客户端的生存者和消费者都无法正常的工作的;所以需要配置启动zookeeper服务。 (1)zookeeper需要java环境 # yum -y install java-1.8.0 解压到指定目录 tar -xzf kafka_2.13-2.8.0.tgz -C /opt/ (2)这里kafka下载包已经包括zookeeper服务,所以只需修改配置文件,启动即可。 如果需要下载指定zookeeper版本;可以单独去zookeeper官网http://mirrors.shu.edu.cn/apache/zookeeper/下载指定版本。 [root@~]# cd /data/kafka_2.13-2.8.0/ [root@ kafka_2.11-2.1.0]# grep “^[^#]” config/zookeeper.properties dataDir=/tmp/zookeeper   #数据存储目录 clientPort=2181   #zookeeper端口 maxClientCnxns=0 注:可自行添加修改zookeeper配置 3.3 配置kafka (1)修改配置文件 [root@ kafka_2.13-2.8.0]# grep “^[^#]” config/server.properties broker.id=0 listeners=PLAINTEXT://localhost:9092 num.network.threads=3 num.io.threads=8 socket.send.buffer.bytes=102400 socket.receive.buffer.bytes=102400 socket.request.max.bytes=104857600 log.dirs=/tmp/kafka-logs num.partitions=1 num.recovery.threads.per.data.dir=1 offsets.topic.replication.factor=1 transaction.state.log.replication.factor=1 transaction.state.log.min.isr=1 log.retention.hours=168 log.segment.bytes=1073741824 log.retention.check.interval.ms=300000 zookeeper.connect=localhost:2181 zookeeper.connection.timeout.ms=6000 group.initial.rebalance.delay.ms=0 注:可根据自己需求修改配置文件  broker.id:唯一标识ID … Read more

centos 网络配置

登陆系统后登陆 切换到网卡的配置文件目录/etc/sysconfig/network-scripts下 # cd /etc/sysconfig/network-scripts 查看网卡名称   ip addr 编辑一个网卡名字的配置文件,如ifcfg-网卡名 (ifcfg-em1) vi ifcfg-em1 把onboot=no 改成 onboot=yes 保存,重启   改IP: vi ifcfg-em1 保存后 ifdown em1 ifup em1 网卡生效 ip a  查看是否生效

Ubuntu命令行链接WIFI

查看是否已经正确安装无线网卡 ip a .启动无线网卡, 如果网卡是wlan0 ip link set wlan0 up .扫描可用的WiFi(没什么用处) # 不加less可能会产生太多输出 iw dev wlan0 scan |less # 或者 iwlist wlan0 scanning .创建口令文件, 并连接 # 建立配置文件 wpa_passphrase ESSID PWD > connect.conf # 使用配置文件连接 wpa_supplicant -B -i wlan0 -Dwext -c ./connect.conf 出现以下错误提示 Successfully initialized wpa_supplicant nl80211: Could not configure driver mode nl80211: deinit ifname=wlan1 disabled_11b_rates=0 … Read more

树莓派 4B 安装 Ubuntu IOT 版

硬件:Raspberry Pi 4B 系统:Ubuntu 21.04 for IOT 官网:https://ubuntu.com/download/raspberry-pi 配置步骤 1. 下载系统镜像 2. 烧录至SD卡进行系统安装 3. 系统登陆 默认账号:ubuntu 默认密码:ubuntu 4. 更换镜像源 4.1 备份 apt 源文件 sudo cp -p /etc/apt/sources.list /etc/apt/sources.list.bak 4.2 编辑 apt 源文件,更新为国内镜像源 sudo nano /etc/apt/sources.list 更新阿里源 #阿里云源 deb http://mirrors.aliyun.com/ubuntu-ports eoan main restricted deb http://mirrors.aliyun.com/ubuntu-ports eoan-updates main restricted deb http://mirrors.aliyun.com/ubuntu-ports eoan universe deb http://mirrors.aliyun.com/ubuntu-ports eoan-updates universe deb … Read more

mysql(mariadb)新建用户及用户授权管理

mysql(mariadb)新建用户及用户授权管理 create user newuser@localhost identified by ‘123456’; 查看用户权限 MariaDB [(none)]> show grants for my@localhost; +——————————————————————————————————————–+ | Grants for my@localhost | +——————————————————————————————————————–+ | GRANT ALL PRIVILEGES ON *.* TO ‘my’@’localhost’ IDENTIFIED BY PASSWORD ‘*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9’ | +——————————————————————————————————————–+ 1 row in set (0.00 sec) MariaDB [(none)]> 指定授权(全部权限) grant insert,update,delete,select on *.* to mytest@localhost;