lighttpd + fastcgi of django deployment

Robbin in reference to "Linux platform to install and configure Ruby on Rails explain" some of the contents: http://www.javaeye.com/topic/43228
This article has been assumed that the correct installation of python and django, system for ubuntu9.04

light footprint + httpd = Lighttpd can be read as Lighty, is a leading German Jan Kneschke developed, based on the open source BSD license WEB server software, and its fundamental purpose is to provide a dedicated web site for high-performance, secure, fast, and compatibility good and flexible web server environment. With very low memory overhead, CPU occupancy rate is low, good performance and a wealth of modules and so on. Lighttpd is a lightweight OpenSource many web server in a relatively good. Support for FastCGI, CGI, Auth, Output compression (output compress), URL rewriting, Alias and other important functions. Therefore very high for those who load the WEB server will be selected Lighttpd is the perfect solution.

1. Install lighttpd
If you use ubuntu, use the command sudo apt-get install lighttpd can. From the source installation methods, as follows:
Extract the installation files (eg: lighttpd-1.5.0-r1691.tar.gz) and switch to the directory in the terminal run:
./configure --prefix=/usr/local/lighttpd
make
sudo make install

Which the prefix parameter specifies the installation path lighttpd
Configuration after installation:
sudo cp doc/rc.lighttpd /etc/init.d/lighttpd
sudo mkdir /etc/lighttpd
sudo cp doc/lighttpd.conf /etc/lighttpd/lighttpd.conf 
sudo gedit /etc/init.d/lighttpd

Startup script will be replaced with the ubuntu system, see: http://redmine.lighttpd.net/wiki/1/ScriptsUbuntu
2. Lighttpd configuration
sudo gedit /etc/lighttpd/lighttpd.conf

server.modules: cancellation of the Notes as follows module mod_rewrite, mod_access, mod_fastcgi, mod_simple_vhost, mod_accesslog
Mod_fastcgi which should be in mod_rewrite, mod_access after mod_accesslog before
# server.document-root point to your django project directory
# For example, I in / home / ruby directory django-admin.py startproject mysite, then server.document-root = "/ home / ruby / mysite"
server.document-root = "/ home / ruby / mysite"
fastcgi.server = (
# This file can be mysite.fcgi does not exist, can be named, and below it (url.rewrite-once) consistent
"/ mysite.fcgi" => (
"main" => (
# Use host / port instead of socket for TCP fastcgi
# Django designated redirected to deal with the visit by the Who, where host and port to run the fcgi parameters and the corresponding
# Such as the following parameters to run fcgi:. / Manage.py runfcgi method = threaded host = 127.0.0.1 port = 3033
"host" => "127.0.0.1",
"port" => 3033,
# "socket" => "/ home / ruby / mysite / mysite.sock",
"check-local" => "disable",
)
),
)
alias.url = (
Midia # point to the admin folder, of course, you can master directory in the project folder of the establishment of the symbolic link, the parameters of the project point to the main directory
"/ media /" => "/ path / to / django_home / django / contrib / admin / media /",
)
url.rewrite-once = (
"^ (/ media .*)$" =>" $ 1 ",
"^ / favicon \. ico $" => "/ media / favicon.ico",
"^(/.*)$" => "/ Mysite.fcgi $ 1", # $ 1 is passed to the django's url parameter fcgi
)
3. Configuration has finished, you can run service
sudo /etc/init.d/lighttpd start   # Start lighttpd  
cd /home/ruby/mysite          # Cut to the project path  
# To run fcgi service thread, where host and port parameters to lighttpd and above  .conf In the definition of consistent  
./manage.py runfcgi method=threaded host=127.0.0.1 port=3033

Ok, open the browser, enter http://127.0.0.1, you will be able to see the index page of the

PS: django to http://127.0.0.1/admin and http://127.0.0.1/admin/ different analytical path, / admin / Jump to the normal, and / admin is a jump / mysite.fcgi / admin /, of course, the 404. Usually add settings.py to FORCE_SCRIPT_NAME =''may be forced after the url /
  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of lighttpd + fastcgi of django deployment

  • Ruby Symbol

    Ruby is a completely cross-platform object-oriented scripting language, built on the Ruby-based Web framework Ruby on Rails (ROR) is the field of web development is gaining increasing acceptance. ROR substantial use of the Ruby language features, Sym ...

  • In the Linux platform to install and configure Ruby on Rails Detailed

    ruby on rails recommend the production environment is running Linux / FreeBSD / Unix, or Unix family of operating systems, using lighttpd + FCGI solution. The following will be my Linux operating system, lighttpd + FCGI, MySQL database as an example, ...

  • In the Windows platform using Apache2.2 and Mongrel running Ruby on Rails

    First, install Ruby, rails, mongrel and Apache2.2 Rubyforge download from the web site One-Click Ruby Install, run setup on installed ruby and rubygems. Run the command: gem install rails-y gem install mongrel-y gem install mongrel_service-y Installe ...

  • Pyronaridine listing! Ruby programming language

    Interactive Net Purchase Excellence Amazon purchase [Original title] The Ruby Programming Language Publishing ] [ O'Reilly Media, Inc. [Author] (United States) David Flanagan; Yukihiro Matsumoto Translator [] LIAO Zhi-gang; Zhang Wo [Name] Books ...

  • RSpec troubleshooting

    1.uninitialized constant Dependencies Conditions: In windows under way to install the RSpec gem and rspec-rails. However, in ruby script / spec_server to do the test under the spec your_spec.rb-X will appear uninitialized constant Dependencies (NameE ...

  • Rails command

    In windowsxp install ruby on rails of sqlite3-ruby problem-solving nmake 'nmake' is not recognized as an internal or external command,

  • RoR explained

    ROR is Ruby on Rails. Ruby is a well-known has been very good dynamic language It's dynamic language. Simple and easy. Dynamic languages are interpreted, but the performance may make a discount, but not absolute, because the application is comple ...

  • Ruby on Rails Routing - Simple Examples

    This article contains a list of ruby on rails routing examples. If you find you have any questions please leave a comment. Routes are processed from the top of routes.rb down. If a route is matched it will stop processing the routes.rb file and use t ...

Leave a Reply

Recent
Recent Entries
Tag Cloud
Random Entries