Pythonのインストール †サーバは、使えるねっと(OSはCentOS)です。 Pythonのインストール †# wget http://www.python.jp/pub/ftp.python.org/python/2.5/Python-2.5.tgz # tar zxvf Python-2.5.tgz # cd Python-2.5 # ./configure --prefix=/usr/local/python # make # make install パスを通す †.bash_profileを変更しパスを追加する †# vim .bash_profile 設定を反映させる †# source ~/.bash_profile 確認 †python -V もし、インストールしたバージョンと違うバージョン(古い)が表示された場合は、サーバに既にインストールされていたpythonがあると思うので、パスを設定すること。 # python -V Python 2.3.4 ↓ # python -V Python 2.5 easy_installをインストール †# wget http://peak.telecommunity.com/dist/ez_setup.py # /usr/local/python/bin/python ez_setup.py easy_installを使ってパッケージをインストールする †なお、今回は、以下のコマンドでインストールしましたが、インストールコマンドは、以下でよいみたいです。 # easy_install -UZ ***** 文書用ユーティリティ †# /usr/local/python/bin/easy_install-2.5 -U -Z docutils MySQL用コネクタ †# /usr/local/python/bin/easy_install-2.5 -U -Z MySQL_Python インタラクティブなPython実装 †# /usr/local/python/bin/easy_install-2.5 -U -Z ipython パッケージ管理 †# /usr/local/python/bin/easy_install-2.5 -U -Z yolk PostgreSQL用コネクタ †# /usr/local/python/bin/easy_install-2.5 -U -Z psycopg2 XMLを使う場合入れておくと幸せになれる †# /usr/local/python/bin/easy_install-2.5 -U -Z lxml==1.3.6 PythonImagingLibrary?インストール †関連パッケージのインストール †# yum install freetype-devel # yum install freetype2-devel # yum install libjpeg-devel # yum install libpng-devel # yum install zlib-devel ImagingLibrary?インストール †コマンド †# wget http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz # tar zxvf Imaging-1.1.6.tar.gz # cd Imaging-1.1.6 # /usr/local/python/bin/python2.5 setup.py build installコマンド †# /usr/local/python/bin/python2.5 setup.py install 確認 †エラーが出ていなければインストール成功。 # /usr/local/python/bin/python2.5 >>> from PIL import Image mod_wsgiインストール †mod_pythonではなくmod_wsgiをインストールする。 インストール †※パスは環境にあわせて変更してください。 # wget http://modwsgi.googlecode.com/files/mod_wsgi-2.0.tar.gz # tar zxvf mod_wsgi-2.0.tar.gz # cd mod_wsgi-2.0 # ./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/local/python/bin/python2.5 # make # make install http.confの設定 †以下の1行を追記する。 # vim /etc/httpd/conf/httpd.conf LoadModule wsgi_module modules/mod_wsgi.so apacheの再起動 †# /etc/init.d/httpd configtest Syntax OK # /etc/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] Comment †
Counter: 67955,
today: 2,
yesterday: 0
|