pencat

从明天起,关心粮食和蔬菜。我有一所房子,面朝大海,春暖花开

« svn 1.50 编译安装django的数据库操作 »

centos5.2下编译安装lighttpd,python2.5,django1.0.2,mysql5.2

mysql
# tar zxvf mysql-5.1.30.tar.gz
# cd mysql-5.1.30
# ./configure --prefix=/usr/local/mysql --enable-thread-safe --enable-assembler --enable-shared --with-charset=utf8 --with-

collation=utf8_general_ci --with-mysqld-ldflags=-all-static --without-debug
# make && make install
# cp /usr/src/mysql-5.1.30/support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# cp support-files/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf
  - skip-federated
  + #skip-federated
# ./scripts/mysql_install_db
# cd /usr/local
# groupadd database
# adduser mysql -G database
# vi /etc/passwd
  - mysql:x:500:501::/home/mysql:/bin/bash
  + mysql:x:500:501::/home/mysql:/sbin/nologin
# chmod 750 mysql -R
# chgrp database mysql -R
# chown mysql mysql/var -R
# ln -s /usr/local/mysql/bin/mysql /sbin/mysql
# ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin
# ln -s /usr/local/mysql/bin/mysql_config /sbin/mysql_config
# service mysqld start

 


Python
# tar zxvf Python-2.5.2.tgz
# cd Python-2.5.2
# ./configure --prefix=/usr/local/python
# make && make install
# ln -s /usr/local/python/bin/python /usr/bin/python
# ln -s /usr/local/python/lib/python2.5 /usr/lib/python2.5

MySQL-python
# tar zxvf MySQL-python-1.2.2.tar.gz
# cd MySQL-python-1.2.2
# python setup.py install
# ln -s /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16 /usr/lib/libmysqlclient_r.so.16
# python
>>> import MySQLdb /检验mysql-python安装是否正确
 


Django
# tar xzvf Django-1.0.2-final.tar.gz
# cd Django-1.0.2-final
# python setup.py install

 


pcre
# tar zxvf pcre-7.8.tar.gz
# cd pcre-7.8
# ./configure
# make && make install

lighttpd
# tar xzvf lighttpd-1.4.20.tar.gz
# cd lighttpd-1.4.20
# ./configure --prefix=/usr/local/lighttpd --disable-ipv6 --with-linux-aio  --without-bzip2
# make && make install
# mkdir /usr/local/lighttpd/conf
# mkdir /usr/local/lighttpd/logs
# cp doc/lighttpd.conf /usr/local/lighttpd/conf/
# vi /usr/local/lighttpd/conf/lighttpd.conf
  @ server.document-root
  @ server.errorlog
  @ index-file.names
  @ accesslog.filename
# cp doc/rc.lighttpd.redhat /etc/rc.d/init.d/lighttpd
# chmod 755 /etc/rc.d/init.d/lighttpd
# vi /etc/rc.d/init.d/lighttpd
  - LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
  + LIGHTTPD_CONF_PATH="/usr/local/lighttpd/conf/lighttpd.conf"
# chkconfig --add lighttpd
# chkconfig --level 345 lighttpd on

 
python-flup
# tar zxvf flup-1.0.1.tar.gz
# cd flup-1.0.1
# python ez_setup.py
# python setup.py install

 

#  
# vi settings.py
  + FORCE_SCRIPT_NAME = ""

# vi /usr/local/lighttpd/conf/lighttpd.conf
  - # mod_rewrite
  + mod_rewrite
  - # mod_fastcgi
  + mod_fastcgi
  + fastcgi.server = ( "/mysite.fcgi" =>
  +                   ( "main" =>
  +                       ( "socket" => "/tmp/fcgi.sock",
  +                         "check-local" => "disable",
  +                       )
  +                   )
  + ) 
  + url.rewrite = (
  +      "^(/media.*)$" => "$1",
  +      "^(/.*)$" => "/mysite.fcgi$1",
  + )


# service lighttpd restart

 

 

#server.document-root        = "/home/radio/htdocs/"
server.document-root = "/home/radio/workspace/pywork/bigcomic/"

     "^(/media.*)$" => "$1",
     "^(/.*)$" => "/mysite.fcgi$1",

 

 

 


 

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Devo Build 80201

Copyright © 1998-2007 bigcomic.com All rights reserved.