windows7+apache24+mysql5.7+python3.7
系统环境:windows7
前言:可以先安装wampserver,我安装时提示缺少MSVCR120.dll,安装MicrosoftVisual C ++ 2012即可(可以在Microsoft下载)

1、安装mysql 5.7
1.1、安装wamp是自带mysql5.7的文件夹,进入mysql的bin目录下
mysqld.exe -install #安装mysql服务
net start mysql #启动mysql

1.2、修改密码
默认安装的mysql是没有密码的
mysql-uroot -p #登录mysql,提示输入密码,直接回车即可
set password for root@localhost = password('123123') #给root设置密码,只能本地登录
grantall privileges on *.* to 'caiwuyun'@'localhost' identified by 'root'; #创建项目使用的账密
flush privileges; #立即生效

1.3、将数据库文件导入
在mysql.ini的[mysqld]加入
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
并重启


2、安装python3.7
前面已经写过文档了,这里省略
3、安装Mod_wsgi模块
我安装的是python3.7,这里使用的mod_wsgi版本是mod_wsgi-4.6.5
3.1、将.whl文件复制到D:\python\Scripts下,这里是python的安装路径
3.2、pip install "mod_wsgi-4.6.5%2Bap24vc14-cp36-cp36m-win_amd64.whl" #安装

4、安装apache24
4.1、cmd进入在apache的bin目录下,运行httpd.exe -r install -n apache
4.2、修改httpd.conf
4.3、指定项目路径

4.4、指定mod_wsgi路径

4.5、重启apache,就可以访问到项目了
网友评论