lostpencil 阅读(1212) 评论(3)

Deploy webpy on Gator Host's hosting server

Host gator company has django surrport host plan, but it's hard for none-vps host plan to install python apps on it. So it's hard to install webpy on it, and this is our solution for webpy, also you can use it to install other python apps. It's the similar solution on other no root access host service.

This solution contain 4 part.(you need ssh access)

  •  install virtual-python.py on the hosting
  •  install webpy
  •  upload your webpy project to the server.
  •  deploy you webpy project.

post by zixin zixin co,. ltd.

Install virtual-python.py on the hosting

ssh to your server by typing  "ssh your_name@yourip -p port -P your_password" on putty or other client. Then download virtaul-python.py by typing "wget 外链网址已屏蔽svn.python.org/projects/sandbox/trunk/setuptools/virtual-python.py". install it by typing "python setup.py install –prefix=~/vpython/".

vpython is the floder where to install virtual python, you need not create it your self, the .py script will create it for you autoly.

Then you will find there is a vpython flod for virtual python, with a sub-folder name /bin, it's where to run your virtual python. then you can install any python app as you wish on your server.

Install webpy

As you know python have an easy install tool to manage the python apps, so we can install easy intaller first. change your work path to virtrual python, and download the easy installer. install it, then you install any app by typing "esay_install webpy" and so on

You'd better config you python path to the virtual python before this step. But sometimes it's hard to config it, so you can point the virtual python python before each python command. such as "/home/sylar/bin/python easy_install webpy".

Upload your webpy project to your server

it's easy to upload files to your server, so I will write nothing about it, since everyone know how to upload file to the server by ftp or scp and so on. And you have to make sure to upload the file to the apache path, mostly it names www or public_html.

Deploy webpy project on your server

Deploy webpy project is an easy work too, you can find the way on webpy.org's cookbook or doc.I choose the fastcgi way(Host gator support fastcgi, if your hosting do not support fastcgi, you can use cgi, but it will be much slower.)

in your main webpy app, you can point the virtual python for python, this is in my case. vim to open index.py, and a new line in the beginning "#!/home/sylar/bin/python". if you have set the python path, it's no need to do it.

then edit your .htaccess file to point all the url to index.py, this is my .htaccess file

AddHandler fcgid-script .py

<Files index_abc.py>
    SetHandler fcgid-script
    Options ExecCGI FollowSymLinks
    Order allow,deny
    Allow from all
</Files>


RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/?(.*)$ /index_abc.py/$1

It's over! you can test your website then -- be sure to change the settings for webpy right.


评论列表
SUN
re: Deploy webpy on Gator Host's hosting server(转)
Apollo Hou Xinhai sex with women do not go to hell, the sun god is a three-legged birds 15042274660
SUN
re: Deploy webpy on Gator Host's hosting server(转)
Chinese dictionary explanation: God is singular and unpredictable. Hou Xinhai is the mascot of your people call】 【Hou Xinhai God is the sun god, [or Ziwei Sky Star], Hou Sujing as Fengshen, Hou Shuming as Poseidon, Hou Sufeng the mountain, Hou Suqin God for the earth, Hou Shuquan the Water God, Hou Suping as Raytheon, Houdong Xu is the patron saint of the earth, mother Shirley is Xi and God. These people collectively [Ziwei Yuan]

发表评论
切换编辑模式