on windows 7 32 bit
Change :
- ServerAdmin with your Administrator Email Address
- ServerName with your Server Name
- Change Path with your Own Path
-
Open Command Prompt (Start > Accessories > Command Prompt)
-
Download and Install Firefox
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://download-installer.cdn.mozilla.net/pub/firefox/releases/26.0/win32/en-US/Firefox%20Setup%20Stub%2026.0.exe', 'C:\Firefox Setup Stub 26.0.exe')"
"C:\Firefox Setup Stub 26.0.exe" -
Download and Install 7 Zip for Extract Web2py Source
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nchc.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.msi', 'C:\7z920.msi')"
C:\7z920.msi /quiet /passive -
Download and Install Python Windows binary
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi', 'C:\python-2.7.6.msi')"
C:\python-2.7.6.msi /quiet /passive -
Download and Install Graphviz
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://www.graphviz.org/pub/graphviz/stable/windows/graphviz-2.36.msi', 'C:\graphviz-2.36.msi')"
C:\graphviz-2.36.msi /quiet /passive -
Download Apache 2.2 with ssl support
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://apache.mirrors.hoobly.com//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi', 'C:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi')"
C:\httpd-2.2.25-win32-x86-openssl-0.9.8y.msi /quiet /passive -
Download Web2py Source Code
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://www.web2py.com/examples/static/web2py_src.zip', 'C:\web2py_src.zip')" -
Download Mod WSGI Win32/Apache 2.2/Python 2.7
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://modwsgi.googlecode.com/files/mod_wsgi-win32-ap22py27-3.3.so', 'C:\mod_wsgi.so')" -
Extract Downloaded Web2py Source Code
"C:\Program Files\7-Zip\7z" x C:\web2py_src.zip -oC:\ -r -
Set Path Variables
setx Path "%PATH%;C:\Python27\Scripts;C:\Python27\;C:\Program Files\Graphviz2.36\bin" -
Backup and Edit Host File on C:\Windows\System32\drivers\etc\hosts
copy C:\Windows\System32\drivers\etc\hosts C:\Windows\System32\drivers\etc\hosts_2
notepad C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost sugizo sugizo.domain.com -
Create Certificate
cd C:\Program Files\Apache Software Foundation\Apache2.2\bin
openssl req -config ../conf/openssl.cnf -new -out ../conf/server.csr -keyout ../conf/server.pem
openssl rsa -in ../conf/server.pem -out ../conf/server.key
openssl x509 -in ../conf/server.csr -out ../conf/server.crt -req -signkey ../conf/server.key -days 365 -
Copy Downloaded Mod WSGI Win32/Apache 2.2/Python 2.7 into Apache Modules
copy "C:\mod_wsgi.so" "C:\Program Files\Apache Software Foundation\Apache2.2\modules\mod_wsgi.so" -
Backup and Edit Apache Configuration
copy "C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf" "C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd_2.conf"
notepad "C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf"
Listen 80
Listen 443
LoadModule ssl_module modules/mod_ssl.so
LoadModule wsgi_module modules/mod_wsgi.so
ServerAdmin sugizo@domain.com
ServerName sugizo.domain.com:80
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/web2py/applications"
ServerName sugizo
<Directory "C:/web2py">
Order allow,deny
Deny from all
</Directory>
<Location "/">
Order deny,allow
Allow from all
</Location>
<LocationMatch "^(/[\w_]*/static/.*)">
Order Allow,Deny
Allow from all
</LocationMatch>
WSGIScriptAlias / "C:/web2py/wsgihandler.py"
</VirtualHost>
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot "C:/web2py/applications"
ServerName sugizo
<Directory "C:/web2py">
Order allow,deny
Deny from all
</Directory>
<Location "/">
Order deny,allow
Allow from all
</Location>
<LocationMatch "^(/[\w_]*/static/.*)">
Order Allow,Deny
Allow from all
</LocationMatch>
WSGIScriptAlias / "C:/web2py/wsgihandler.py"
SSLEngine On
SSLCertificateFile conf/server.crt
SSLCertificateKeyFile conf/server.key
</VirtualHost> -
Copy web2py wsgihandler.py
copy C:\web2py\handlers\wsgihandler.py C:\web2py\ -
Copy web2py parameters_8000.py into parameters_80.py and parameters_443.py
copy C:\web2py\parameters_8000.py C:\web2py\parameters_80.py
copy C:\web2py\parameters_8000.py C:\web2py\parameters_443.py -
Restart Apache Server
sc stop Apache2.2
sc start Apache2.2 -
Open your Browser and go to
"C:\Program Files\Mozilla Firefox\firefox.exe" http://localhost/welcome/default/index
"C:\Program Files\Mozilla Firefox\firefox.exe" https://localhost/welcome/default/index
if you want pygraphviz library
get the pygraphviz in here
http://www.lfd.uci.edu/~gohlke/pythonlibs/tpxjckqh/pygraphviz-1.2.win32-py2.7.exe
and then install it
Comments (0)