Linux操作系统下轻松配置Ruby的程序环境Ruby安装包 下载地址:http://www.ruby-lang.org/en/downloads/ ruby-1.8.6-p111.tar.gz 解压并安装: tar -xvzf ruby-1.8.6-p111.tar.gz cd ruby-1.8.6-p111 ./configure -prefix=/opt/modules/ruby make make install 操作系统PATH路径: export PATH=/opt/modules/ruby/bin:$PATH
rails远程安装: gem下载地址:http://rubyforge.org/projects/rubygems/ 解压并安装: tar xzvf rubygems-1.0.1.tgz cd rubygems-1.0.1/ ruby setup.rb ruby/bin/gem install rails --remote mysql_ruby驱动安装 下载地址:http://www.tmtm.org/en/mysql/ruby/ 解压并安装: tar -xvzf mysql-ruby-2.7.4.tar.gz cd mysql-ruby-2.7.4 ruby extconf.rb --with-mysql-dir=/opt/modules/mysql/ make && make install fast-cgi安装: 下载地址:http://www.fastcgi.com/dist/ 解压并安装: tar xzvf fcgi-2.4.0.tar.gz cd fcgi-2.4.0 ./configure --prefix=/opt/modules/fcgi make && make install 安装ruby的fcgi支持库: tar xzvf ruby-fcgi-0.8.7.tar.gz cd ruby-fcgi-0.8.7 ruby install.rb config -- --with-fcgi-include=/opt/modules/fcgi/include --with-fcgi-lib=/opt/modules/fcgi/lib ruby install.rb setup ruby install.rb install
Lighttpd安装: 下载地址:http://www.lighttpd.net/download/ 注意: 安装前要检查linux中的pcre,在RedHat中会默认安装pcre-4.5-3.2.RHEL4,这个版本不支持lighttpd. 必须下载另外两个rpm,grep-2.5.1-32.2.i386.rpm和pcre-devel-4.5-3.2.SEL4.i386.rpm, 下载地址:http://scientificlinux.physik.uni-muenchen.de/mirror/scientific/43/i386/errata/fastbugs/RPMS/grep-2.5.1-32.2.i386.rpm
下载地址:ftp://ftp.pbone.net/mirror/www.startcom.org/AS-4.0.0/os/i386/StartCom/RPMS/pcre-devel-4.5-3.2.SEL4.i386.rpm
安装命令为:rpm -ivh rpm包名
解压并安装: tar xzvf lighttpd-1.4.18.tar.gz ./configure --prefix=/opt/modules/lighttpd make && make install
配置环境: 1.将lighttpd的配置文件放到/etc/lighttpd/ cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd mkdir /etc/lighttpd cp doc/lighttpd.conf /etc/lighttpd/lighttpd.conf
2.将启动服务器的启动文件放入到用户的目录中 cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd 编辑此文件: LIGHTTPD_BIN=/usr/sbin/lighttpd 改为 LIGHTTPD_BIN=/usr/local/lighttpd/sbin/lighttpd
希望服务器启动的时候就启动lighttpd,那么: chkconfig lighttpd on
配置Lighttpd
修改/etc/lighttpd/lighttpd.conf
1)server.modules 取消需要用到模块的注释,mod_rewrite,mod_access,mod_fastcgi,mod_simple_vhost,mod_cgi,mod_compress,mod_accesslog是一般需要用到的。
2)server.document-root, server.error-log,accesslog.filename需要指定相应的目录
3)用什么权限来运行lighttpd,默认将使用root用户进行运行。 server.username = "nobody" server.groupname = "nobody" 从安全角度来说,不建议用root权限运行web server,可以自行指定普通用户权限。
4)静态文件压缩 compress.cache-dir = "/tmp/lighttpd/cache/compress" compress.filetype = ("text/plain", "text/html","text/javascript","text/css")
上一篇:在虚拟机Redhat Linux下安装Samba服务器 下一篇:Linux操作系统下源码阅读工具ctags+vim 更多相关文章
|
推荐文章
精彩文章
|