Linux Web.py网站迁移Mac OS X

  1. 数据库导出

    mysqldump --opt -u name -p dbname > backupfile.sql
    
  2. 在Mac OS X上安装web.py环境
    0)install web.py

    sudo pip install web.py
    

1) 安装mod_wsgi
下载mod_wsgi

http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2

解压,

./configure

make

sudo make install

2) 配置apache httpd.conf

#Load mod_wsgi module:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so

WSGIScriptAlias /ota /Users/iosteam/ota_all/website.py/

AddType text/html .py

Alias /ota/static "/Users/iosteam/ota_all/static"

<Directory "/Users/iosteam/ota_all">

  Order deny,allow

  Allow from all

</Directory>

3) 如果仍不能访问,修改对应的webpy启动文件

# for mod_python

app = web.application(urls, globals())

application = app.wsgifunc()
  1. 导入数据库数据

    mysql -u root -p < database.sql
    
  2. 安装python连接数据库包

    sudo pip search MySQL_python
    sudo pip install MySQL_python