安装包
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel openssl openssl-devel -y
yum -y install python36-devel -y
1,安装python3.7
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7rc1.tgz
tar -xzf Python-3.7.7rc1.tgz
cd Python-3.7.7rc1
mkdir -p /home/zsy/software/python37
./configure --prefix="/home/zsy/software/python37
安装python3
make
make install
添加环境变量
vim .bashrc
#添加该语句
alias python3=/home/zsy/software/python37/bin/python3.7
alias pip3=/home/zsy/software/python37/bin/pip3.7
#使修改的内容生效
source .bashrc
查看版本
python3 -V
pip3 -V
2,安装nginx16
用root安装 yum -y install gcc-c++
一下用对应用户安装
wget http://nginx.org/download/nginx-1.16.1.tar.gz
tar -xzf nginx-1.16.1.tar.gz
#下载依赖包
pcre和zlib
https://sourceforge.net/projects/pcre/files/pcre/8.40/pcre-8.40.tar.gz/download
http://www.zlib.net/
tar -xzf pcre-8.40.tar.gz
tar -xzf zlib-1.2.11.tar.gz
mkdir /home/zsy/software/pcre84
mkdir /home/zsy/software/zlib12
cd pcre-8.40
./configure --prefix=/home/zsy/software/pcre84
make
make install
cd zlib-1.2.11
./configure --prefix=/home/zsy/software/zlib12
make && make install
nginx安装
cd nginx-1.16.1
./configure --prefix=/home/zsy/software/nginx16 --with-http_stub_status_module --with-pcre=/home/zsy/software/pcre-8.40 --with-zlib=/home/zsy/software/zlib-1.2.11
其中参数http_stub_status_module是开启stub_status模块,它主要用于查看Nginx的一些状态信息。后面两个用来指定两个依赖的源码目录。
make && make install
将conf/nginx.conf下端口修改
在linux下,普通用户只能用1024以上的端口,而1024以内的端口只能由root用户才可以使用,所以这里80端口只能由root才能使用。
cd ~ #回到根目录
cd nginx
./sbin/nginx #启动nginx
netstat -nlp | grep 8888 #查看8888端口情况
ps -ef | grep nginx #查看根nginx相关的进程列表
kill -9 端口号
http://47.104.197.246:8888/ #服务器开放8888端口,浏览器输入可看到nginx默认界面
3,安装mysql https://blog.csdn.net/allway2/article/details/98203767
检测是否安装mysql
rpm -qa | grep mysql
rpm -qa | grep mariadb
如果安装
// 普通删除模式
rpm -e mysql
// 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
rpm -e --nodeps mysql
rpm -e --nodeps mariadb
#提前下载mysql依赖包
yum install make cmake libaio wget -y
yum install numactl.x86_64
#下载压缩包,解压压缩包
wget https://dev.mysql.com/downloads/file/?id=505123
tar -xvf mysql-8.0.24-1.el8.x86_64.rpm-bundle.tar -C /home/zsy/software/mysql8
#初始化数据库
/home/zsy/software/mysql8/bin/mysqld --initialize --basedir=/home/zsy/software/mysql8 --datadir=/home/zsy/software/mysql8/data
#注意最后一行密码 L_xx2fb4InRF
创建配置文件
vi /home/zsy/software/mysql8/my.cnf
[mysqld]
sql_mode=STRICT_ALL_TABLES
port=8806
basedir=/home/zsy/software/mysql8
datadir=/home/zsy/software/mysql8/data
max_connections=2000
max_connect_errors=10
character-set-server=utf8
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
启动mysql
bin/mysqld_safe --defaults-file=/home/zsy/software/mysql8/my.cnf
bin/mysqld --defaults-file=/home/zsy/software/mysql8/my.cnf
查看mysql状态
ps -ef|grep mysql
添加环境变量 vi .bash_profile
export PATH=$PATH:/home/zsy/software/mysql8/bin
连接登录
mysql -u root -p
进入mysql改密码
alter user'root'@'localhost' identified by 'root';
关闭mysql
./mysqladmin -uroot -proot shutdown
非正常关闭
ps -ef|grep mysql
kill -9 端口号