Linux Web.py網站遷移Mac OS X

1. 數據庫導出 html

mysqldump --opt -u name -p dbname > backupfile.sql



2. 在Mac OS X上安裝web.py環境

0)install web.py python

sudo pip install web.py



1) 安裝mod_wsgi

下載mod_wsgi mysql

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

解壓, web

./configure sql

make shell

sudo make install 數據庫

2) 配置apache httpd.conf apache

#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()

3. 導入數據庫數據

mysql -u root -p < database.sql



4. 安裝python鏈接數據庫包

sudo pip search MySQL_python
sudo pip install MySQL_python
5. 啓動apache服務器
相關文章
相關標籤/搜索