In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to build the system development environment for CentOS5.2 Apache". In the daily operation, I believe that many people have doubts about how to build the system development environment for CentOS5.2 Apache. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to build a system development environment for CentOS5.2 Apache". Next, please follow the editor to study!
To recommend a good use of the CentOS5.2 Apache system, such as let you have an understanding of the CentOS5.2 Apache system, and then a comprehensive introduction to the CentOS5.2 Apache system, the characteristics and versions of CentOS Linux CentOS community Linux distribution is called CentOS Linux, due to the use of RHEL source code recompiled to generate a new release, CentOS Linux has very good compatibility with RHEL products, and is born with many excellent features of RHEL. I hope it works for all of you. Building Ruby on Rails development environment under CentOS5.2 Apache has recently taken a fancy to Ruby on Rails's agile development technology, although it is no longer a new thing, but watching it becoming more and more popular, I still want to take a look inside, ah, let's start with building a Ruby on Rails environment.
Install Ruby under 1.CentOS5.2 Apache
The rails framework is also made by Ruby. Naturally, you have to install Ruby first. Yum install ruby-y confirm Ruby-v.
Install RubyGems under 2.CentOS5.2 Apache
RubyGems is the management system of Ruby function library. Before that, it is necessary to import dlutter software repository [root@host1] # vi / etc/yum.repos.d/dlutter.repo to [dlutter] name=Unsupported RHEL5 packages (lutter) baseurl= http://people.redhat.com/dlutter/yum/rhel/5/$basearch/enabled=0gpgcheck=0 to confirm [root@host1 ~] # yum-- enablerepo=dlutter list, and then directly install RubyGems [root@host1 ~] # yum-enablerepo=dlutter-y install rubygems.noarch confirmation. Version [root@host1 ~] # gem-- version1.2.0 installed should be version 1.2.0 * * is 1.3.0. Interested friends can use source code to compile and upgrade.
Import of 3.rails framework
This is relatively simple, directly use RubyGems to install [root@host1 ~] # gem install rails
4. The most critical and complicated step is the import of Web server under CentOS5.2 Apache.
There is usually a lot of controversy about the choice of Web server. As far as Ruby on Rails is concerned, many of them use lighttpd as Web Server and FastCGI application to run, but lighttpd is still very difficult to replace CentOS5.2 Apache, especially when there are other Web programs besides Rails program, it is unlikely to be completely transplanted to lighttpd, so here, only Rails program runs on lighttpd, and the request for Rails program is transferred through CentOS5.2 Apache. Install FastCGI first
[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*
Next, import the FastCGI package of Ruby with RubyGems, and then install the lighttpd server, first import the RPMforge software repository.
[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
Confirm [root@host1 ~] # yum-- enablerepo=rpmforge list
Start installation
[root@host1] # yum-- enable=rpmforge install lighttpd
[root@host1 ~] # yum-- the general enable=rpmforge install lighttpd-fastcgi system already has services under CentOS5.2 Apache. To avoid conflicts, you need to configure 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 ← port set to 3000 do not repeat with # server.bind= "127.0.0.1" server.bind= "localhost" self-launch [root@host1 ~] # chkconfig lighttpd on
Basic settings for Rails applications
[root@host1 ~] # cd / srv/www/lighttpd
[root@lighttpd] # mkdir rails
[root@lighttpd] # rails. / rails
Permissions granted to lighttpd users
[root@host1 ~] # cd
[root@host1] # chown-R lighttpd. / srv/www/lighttpd/rails
[root@host1 ~] # chmod + x / srv/www/lighttpd/rails/public/dispatch.*
The setting under CentOS5.2 Apache
[root@host1 ~] # vi / etc/lighttpd/lighttpd.conf
Add at the end $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 also set up the CentOS5.2 Apache to forward the request for Rails to 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/
It's done. If you reload the settings, you can import root@host1 ~] # / etc/init.d/httpd reload*** into the image processing library and the database SQLite3. All these are relatively simple and easy to go through.
[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 is finally completed. Open the rails service and see the results. Note that you are running port 80 under CentOS5.2 Apache.
At this point, the study on "how to build a system development environment for CentOS5.2 Apache" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.