自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CentOS5.2 Apache搭建系統(tǒng)開發(fā)環(huán)境

系統(tǒng) Linux
但是lighttpd還是很難代替CentOS5.2 Apache的地位,特別是Rails程序以外還有其他Web程序的時候、不大可能完全移植到lighttpd上的,所以在這里,只是Rails程序跑在lighttpd上,對Rails程序的請求通過CentOS5.2 Apache下轉(zhuǎn)送過來。

對大家推薦很好使用的CentOS5.2 Apache系統(tǒng)之前,像讓大家對CentOS5.2 Apache系統(tǒng)有所了解,然后對CentOS5.2 Apache系統(tǒng)全面講解介紹,CentOS Linux的特點(diǎn)和版本CentOS社區(qū)的Linux發(fā)行版本被稱為CentOS Linux,由于使用了由RHEL的源代碼重新編譯生成新的發(fā)行版本,CentOS Linux具有與RHEL產(chǎn)品非常好的兼容性,并且與生俱來地?fù)碛蠷HEL的諸多優(yōu)秀特性。希望對大家有用。CentOS5.2 Apache下搭建Ruby on Rails開發(fā)環(huán)境 最近看上了Ruby on Rails的敏捷開發(fā)技術(shù)了,雖然早已不是什么新鮮玩意了,不過看著它越來越流行了,還是想看一看里面的究竟啊, 先從搭建Ruby on Rails的環(huán)境入手吧。

1.CentOS5.2 Apache下安裝Ruby
rails框架也是Ruby做的,自然要先安裝Ruby了,yum install ruby -y確認(rèn)一下Ruby -v
 
2.CentOS5.2 Apache下安裝RubyGems
RubyGems是Ruby函數(shù)庫的管理系統(tǒng)在此之前先要導(dǎo)入dlutter軟件倉庫[root@host1 ~]# vi /etc/yum.repos.d/dlutter.repo修改成[dlutter]name=Unsupported RHEL5 packages (lutter)baseurl=http://people.redhat.com/dlutter/yum/rhel/5/$basearch/enabled=0gpgcheck=0確認(rèn)[root@host1 ~]# yum --enablerepo=dlutter list然后直接用命令安裝RubyGems [root@host1 ~]# yum --enablerepo=dlutter -y install rubygems.noarch 確認(rèn)版本[root@host1 ~]# gem --version1.2.0安裝好應(yīng)該是1.2.0的版本,***是1.3.0的,有興趣的朋友可以用源碼編譯升級

3.rails框架的導(dǎo)入
這個比較簡單,直接用RubyGems來安裝[root@host1 ~]# gem install rails

4.最關(guān)鍵也是比較復(fù)雜的一步是CentOS5.2 Apache下 Web服務(wù)器的導(dǎo)入
關(guān)于Web服務(wù)器的選擇,通常有很多爭議,就Ruby on Rails而言,很多都是采用lighttpd當(dāng)作Web Server,當(dāng)作FastCGI應(yīng)用程序來跑,但是lighttpd還是很難代替CentOS5.2 Apache的地位,特別是Rails程序以外還有其他Web程序的時候、不大可能完全移植到lighttpd上的,所以在這里,只是Rails程序跑在lighttpd上,對Rails程序的請求通過CentOS5.2 Apache下轉(zhuǎn)送過來。先安裝FastCGI
[root@host1 ~]# wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
[root@host1 ~]# tar zxvf fcgi-2.4.0.tar.gz
[root@host1 ~]# cd fcgi-2.4.0
[root@host1 fcgi-2.4.0]# ./configure
[root@host1 ~]# gem install fcgi
[root@host1 fcgi-2.4.0]# make
[root@host1 fcgi-2.4.0]# make install
[root@host1 fcgi-2.4.0]# cd
[root@host1 ~]# rm -rf fcgi-2.4.0*

下面用RubyGems把Ruby的FastCGI的包導(dǎo)進(jìn)來接下去就要安裝lighttpd服務(wù)器了,先導(dǎo)入RPMforge 軟件倉庫
[root@host1 ~]# wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
[root@host1 ~]# rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
[root@host1 ~]# vi /etc/yum.repos.d/rpmforge.repoenabled = 1enabled = 0
[root@host1 ~]# wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
[root@host1 ~]# rpm --import RPM-GPG-KEY.dag.txt
確認(rèn)[root@host1 ~]# yum --enablerepo=rpmforge list

開始安裝
[root@host1 ~]# yum --enable=rpmforge install lighttpd
[root@host1 ~]# yum --enable=rpmforge install lighttpd-fastcgi一般系統(tǒng)已經(jīng)有CentOS5.2 Apache下服務(wù)了,為了避免沖突,還要配置一下lighttpd,
[root@host1 ~]# vi /etc/lighttpd/lighttpd.conf#"mod_rewrite",#"mod_redirect",#"mod_alias","mod_rewrite","mod_redirect","mod_alias","mod_fastcgi","mod_fastcgi",
#server.port= 81server.port= 3000  ←端口設(shè)置成3000不要與CentOS5.2 Apache下的重復(fù)#server.bind= "127.0.0.1"server.bind= "localhost" 自啟動[root@host1 ~]# chkconfig lighttpd on

Rails應(yīng)用程序的基本設(shè)置
[root@host1 ~]# cd /srv/www/lighttpd
[root@lighttpd]# mkdir rails
[root@lighttpd]# rails ./rails

賦予lighttpd用戶的權(quán)限
[root@host1 ~]# cd
[root@host1 ~]# chown -R lighttpd. /srv/www/lighttpd/rails
[root@host1 ~]# chmod +x /srv/www/lighttpd/rails/public/dispatch.*

CentOS5.2 Apache下的設(shè)
[root@host1 ~]# vi /etc/lighttpd/lighttpd.conf
加在末尾$HTTP["host"] =~ "ithurricane.dip.jp" {server.document-root = "/srv/www/lighttpd/rails/public"alias.url = ( "/" => "/srv/www/lighttpd/rails/public/" )server.indexfiles = ( "index.html", "dispatch.fcgi" )accesslog.filename = "/var/log/lighttpd/access.log"server.errorlog = "/var/log/lighttpd/server.log"server.error-handler-404 = "/dispatch.fcgi"
url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )

fastcgi.server = (".fcgi" => ("localhost" => ("socket" => "/tmp/rails.fcgi.socket","bin-path" => "/srv/www/lighttpd/rails/public/dispatch.fcgi","bin-environment" => ("RAILS_ENV" => "production","RAILS_ROOT" => "/srv/www/lighttpd/rails"),"idol-timeout" => 10,"check-local" => "disable","min-procs" => 1,"max_procs" => 20)))}[root@host1 ~]# /etc/init.d/lighttpd start下面還要設(shè)置一下CentOS5.2 Apache下把對Rails的請求轉(zhuǎn)發(fā)到lighttpd[root@host1 ~]# vi /etc/httpd/conf.d/virtualhost.conf
ServerName ithurricane.dip.jp
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://127.0.0.1:3000/

大功告成,重載一下設(shè)定即可root@host1 ~]# /etc/init.d/httpd reload***導(dǎo)入圖像處理庫,和數(shù)據(jù)庫SQLite3,這些都比較簡單,一筆帶過了,
[root@host1 ~]# yum install freetype
[root@host1 ~]# yum install libpng
[root@host1 ~]# yum install gd-devel
[root@host1 ~]# gem install ruby-gd -- --build-flag --with-freetype
[root@host1 ~]# gem install sqlite3-rubySelect which gem to install for your platform (i686-linux)
1. sqlite3-ruby 1.2.1 (ruby)
2. sqlite3-ruby 1.2.1 (mswin32)
3. sqlite3-ruby 1.2.0 (mswin32)
4. sqlite3-ruby 1.2.0 (ruby)
5. Skip this gem
6. Cancel installation> 1終于完成了,把rails的服務(wù)打開來,看看成果吧,注意跑的是CentOS5.2 Apache下的80端口

【編輯推薦】

  1. CentOS 5編譯編譯基本類系統(tǒng)軟件(linux)
  2. 運(yùn)用CentOS RPM安裝CentOS 5.2中相關(guān)軟件如vhmgr
  3. CentOS 5安裝基本系統(tǒng)與環(huán)境部署及調(diào)整
  4. CentOS 5.4安裝相關(guān)系統(tǒng)文件方法
  5. Centos 5.1系統(tǒng)中安裝NTFS設(shè)置使用
責(zé)任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-05-28 10:22:41

搭建SVN

2010-05-12 21:54:00

網(wǎng)管

2012-04-28 08:43:12

CentOS

2020-12-10 09:48:15

鴻蒙Linux開發(fā)

2022-01-24 18:35:56

OpenHarmon鴻蒙操作系統(tǒng)

2011-03-21 11:33:09

LAMPApache

2010-01-13 10:14:45

2011-04-12 16:00:42

銀行系統(tǒng)周偉然

2014-08-05 16:30:12

CentOS6LAMP

2021-04-15 08:45:25

Zabbix 5.2Apache監(jiān)控

2013-07-23 06:11:44

Android開發(fā)學(xué)習(xí)Android開發(fā)環(huán)境Java

2022-09-19 14:13:15

RabbitMQ系統(tǒng)開發(fā)

2024-03-26 15:19:36

鴻蒙應(yīng)用開發(fā)開發(fā)工具

2009-07-26 19:54:47

suseLinux操作系統(tǒng)

2010-09-14 09:24:29

C語言

2010-03-25 14:42:33

2009-03-10 18:36:56

LinuxLAMP環(huán)境搭建

2012-10-12 10:30:37

PHPOauth

2011-05-26 10:33:26

Android開發(fā)

2017-09-11 14:35:34

編輯器開發(fā)環(huán)境React
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號