nginx
参考文件:
nginx中文文档,https://www.nginx.cn/install
环境准备
安装make
yum -y install gcc automake autoconf libtool make安装g++
yum install gcc gcc-c++安装pcre(为了重写依赖)
cd /usr/local/src
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -zxvf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
make install安装zlib(为了解压缩)
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install安装openssl(不是必要)
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar -zxvf openssl-1.1.1g.tar.gz安装nginx
cd /usr/local/src
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
./configure --sbin-path=/usr/local/nginx/nginx
--conf-path=/usr/local/nginx/nginx.conf
--pid-path=/usr/local/nginx/nginx.pid
--with-http_gzip_static_module
--with-http_stub_status_module
--with-file-aio
--with-http_realip_module
--with-http_ssl_module
--with-pcre=/usr/local/src/pcre-8.44
--with-zlib=/usr/local/src/zlib-1.2.11
--with-openssl=/usr/local/src/openssl-1.1.1g
make -j2
make install
6、创建软连接
ln -s /usr/local/nginx/nginx /usr/local/bin/
7、其他
nginx默认占用80端口,外面可能需要开放端口号
redis
下载文件
先安装5.x版本,6.0版本安装有些问题
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 MALLOC=libc2
安装
make install PREFIX=/usr/local/redis
cp redis.conf /usr/local/redis/redis.conf
python3
基础环境检查
- gcc安装
yum -y install gcc - 其他依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
安装
下载源码
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
解压:tar -zxvf Python-3.8.2.tgz
cd Python-3.8.2安装
创建文件夹:mkdir /usr/local/python3
./configure --prefix=/usr/local/python3
make && make install建立软连接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3测试
python3
mysql8
基础
安装MySQL RPM包
- 下载RPM文件
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm - 安装RPM源
yum localinstall mysql80-community-release-el7-1.noarch.rpm - 查看本地源是否安装成功
yum repolist enabled | grep "mysql.-community."
安装MySQL
- 安装MySQL Server
yum install mysql-community-server - 启动mysql服务
service mysqld start - 设为开机启动
systemctl enable mysqld
systemctl daemon-reload - 查看是否启动
service mysqld status
MySQL数据修改
- 查看临时密码
grep 'temporary password' /var/log/mysqld.log - 修改密码
mysql -uroot -p
use mysql
alter user 'root'@'%' identified with mysql_native_password by 'Shx_11111'; - 允许远程用户登陆
grant all on . to 'root'@'%';
flush privileges;