(Python Flask 构建微电影视频网站)项目_生产环境部署(LNMP)

centos系统

 

安装依赖

yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ pcre-devel httpd-tools

 

安装python

# 解包
tar -zxf Python-3.6.1.tgz

cd Python-3.6.1/

# 设置安装目录
./configure --prefix=/usr/local

# 编译
make

#安装
make altinstall

cd ~
ls /usr/local/bin/
mv python python.backup

#建立软链接
ln -s /usr/local/bin/python3.6 /usr/bin/python
ln -s /usr/local/bin/python3.6 /usr/bin/python3

cd /usr/bin/
ls yum*

# 更改yum脚本配置
vim yum
[
#!/usr/bin/python2
]
vim yum-config-manager
[
#!/usr/bin/python2 -tt
]
vim yum-debug-restore
[
#!/usr/bin/python2 -tt
]
vim yum-groups-manager
[
#!/usr/bin/python2 -tt
]
vim yum-builddep
[
#!/usr/bin/python2 -tt
]
vim yum-debug-dump
[
#!/usr/bin/python2 -tt
]
vim yumdownloader
[
#!/usr/bin/python2
]
vim /usr/libexec/urlgrabber-ext-down
[
#!/usr/bin/python2
]

python

 

安装Mysql

yum -y install mariadb-server

#修改字符集
vim /etc/my.cnf
[
character-set-server=utf8
]

#启动
systemctl start mariadb.service

# 设置开机启动
systemctl enable mariadb.service

# 修改数据库密码
mysqladmin -uroot password "root"

#登录
mysql -uroot -proot

 

安装Nginx

# 解包
tar -zxf nginx-1.12.0.tar.gz

cd nginx-1.12.0/
ls
useradd nginx
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_mp4_module --with-http_flv_module

# 编译后安装
make && make install

# 软连接
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/

cd~

#启动
nginx

# 查看端口
netstat -anptu | grep nginx


127.0.0.1:80

ginx

posted @ 2021-05-21 15:35  嘆世殘者——華帥  阅读(232)  评论(0编辑  收藏  举报