centos7 安装python37 Nginx redis MySQL Sqlite3

全部操作都在root用户下执行

1.安装编译相关工具

yum -y groupinstall "Development tools"
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
yum install libffi-devel -y

2.下载安装包解压

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar -xvJf  Python-3.7.0.tar.xz

3.编译安装

mkdir /usr/local/python3 #创建编译安装目录
cd Python-3.7.0
./configure --prefix=/usr/local/python3
make && make install

4.创建软连接

ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3

5.验证是否成功

python3 -V
pip3 -V




2 添加Nginx的源

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

3 安装Nginx

yum install -y nginx

安装成功后,配置文件目录为/etc/nginx

4 启动Nginx

systemctl start nginx.service #启动Nginx
systemctl enable nginx.service #设置开机自启

5 浏览器中访问

 输入ip

 

 

1. yum安装redis

yum install -y epel-release
yum install -y redis

2. 启动redis

service redis start #启动redis
service redis status #查看redis状态
---
ps -ef | grep redis #查看redis进程
service redis stop #停止redis

3. 设置开机自启

chkconfig redis on

4. 修改redis配置

vim /etc/redis.conf

修改如下内容:

port 6379 #启动端口
requirepass 111111 #访问密码

重启redis

service redis restart

5. 登录redis

注: 127.0.0.1:6379>为redis数据库前缀

redis-cli #登录redis
127.0.0.1:6379> auth 111111 #认证登录
127.0.0.1:6379> keys * #查看当前的key

 

 

1. 下载安装mysql yum 源

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum install -y mysql57-community-release-el7-10.noarch.rpm

2. 安装mysql并启动

yum install -y mysql-community-server #安装mysql
systemctl start  mysqld.service #启动
systemctl status mysqld.service #查看运行状态

3. 登录mysql

grep "password" /var/log/mysqld.log #查看mysql生成的密码
mysql -uroot -p #以root用户登录mysql

4. 修改root密码

注: mysql> 为提示符;新密码需符合:包含字母大小写、特殊符和数字,且位数大于4

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

5. 授权root用户远程访问

mysql> use mysql;
mysql> grant all privileges  on *.* to root@'%' identified by "password";
mysql> flush privileges;

 

 

1.安装编译工具

同上

2.下载安装包

cd /opt 
wget http://www.sqlite.org/2015/sqlite-autoconf-3081101.tar.gz #下载安装包
tar zxvf sqlite-autoconf-3081101.tar.gz  #进行解压

3.编译安装

cd sqlite-autoconf-3081101/
./configure
make && make install
yum install sqlite-devel

4.链接sqlite3

cd #回到用户目录
sqlite3 #链接sqlite3

 

5.退出sqlite3

sqlite3链接成功后,执行如下:

sqlite> .quit #退出sqlite3
 
posted @ 2019-10-15 16:49  _Alexis  阅读(280)  评论(0编辑  收藏  举报