Projekat

Općenito

Profil

Akcije

Prijedlozi #15845

Zatvoren

apache modules

Dodano od Ernad Husremović prije više od 17 godina. Izmjenjeno prije skoro 16 godina.

Status:
Odbačeno
Prioritet:
Normalan
Odgovorna osoba:
Kategorija:
-
Početak:
16.11.2008
Završetak:
% završeno:

20%

Procjena vremena:

Opis

kako napraviti apache module


Fajlovi

mod_methods-0.3.tar.gz (33,9 KB) mod_methods-0.3.tar.gz Ernad Husremović, 18.11.2008 23:54

Povezani tiketi 1 (0 otvoreno1 zatvoren)

korelira sa rails - Prijedlozi #15843: phusion Passenger - mod_rails (rails via apache)ZatvorenoErnad Husremović16.11.2008

Akcije
Akcije #2

Izmjenjeno od Ernad Husremović prije više od 17 godina

  • Naslov promijenjeno iz apache toolbox u apache modules
Akcije #3

Izmjenjeno od Ernad Husremović prije više od 17 godina

http://wiki.modruby.net/en/?FAQ

mod_ruby embeds the Ruby interpreter into the Apache web server, allowing Ruby CGI scripts to be executed natively. These scripts will start up much faster than without mod_ruby.

Akcije #4

Izmjenjeno od Ernad Husremović prije više od 17 godina

mod_ruby podešenje

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ ls /var/www/*ruby/*
/var/www/eruby/test.rhtml /var/www/ruby/test.rb

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ cat /var/www/*ruby/*rhtml

#!/usr/bin/eruby

<html>
 <head>
  <title>Welcome to eruby Test</title>
 </head>
<body>
<h2>eRuby test</h2>
<pre>
<%
    3.times {
        puts "selam alejkum dunja" 
    }
%>
</pre>
</body>
</html>

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ cat /var/www/*ruby/test.rb

#!/usr/bin/ruby

puts "selam alejkum dunja:" 

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ sudo invoke-rc.d apache2 reload

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ cat /etc/apache2/sites-available/ruby

<IfModule mod_ruby.c>
  # for Apache::RubyRun
  RubyRequire apache/ruby-run

  # da browser zna da je html output
  AddType text/html .rhtml

  #DocumentRoot "/home/hernad/devel/apache" 

  # exec files under /ruby as ruby scripts.
  <Location /ruby>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    Options +ExecCGI
  </Location>

  # trebam za run eruby-ja
  RubyRequire apache/eruby-run

  # Handle files under /eruby as eRuby files
  <Location /eruby>
    SetHandler ruby-object
    RubyHandler Apache::ERubyRun.instance
  </Location>

  # Handle *.rhtml files as eRuby files
  <Files *.rhtml>
    SetHandler ruby-object
    RubyHandler Apache::ERubyRun.instance
  </Files>

</IfModule>

#sudi apt-get install ruby eruby

enableovo ruby

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ sudo a2ensite ruby

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ w3m 127.0.0.1/ruby/test.rb

=> ok

hernad@nmraka-1:~/devel/apache/mod-ruby-1.2.6$ w3m 127.0.0.1/eruby/test.rhtml

=> ok (html)

Akcije #5

Izmjenjeno od Ernad Husremović prije više od 17 godina

  • % završeno promijenjeno iz 0 u 20
Akcije #8

Izmjenjeno od Ernad Husremović prije više od 17 godina

mod_xsendfile:http://tn123.ath.cx/mod_xsendfile/ is a small Apache2 module that processes X-SENDFILE headers registered by the original output handler.

If it encounters the presence of such header it will discard all output and send the file specified by that header instead using Apache internals including all optimizations like caching-headers and sendfile or mmap if configured.

It is useful for processing script-output of e.g. php, perl or any cgi.

Akcije #9

Izmjenjeno od Ernad Husremović prije više od 17 godina

XSendFile example

.htaccess

<Files out.php>
XSendFile on
</Files>

out.php

<?php
...
if ($user->isLoggedIn())
{
    header("X-Sendfile: $somefile");
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; file=\"$somefile\"");
    exit;
}
?>
<h1>Permission denied</h1>
<p>Login first!</p>

Akcije #10

Izmjenjeno od Ernad Husremović prije više od 17 godina

X-Sendfile

Send files faster with X-Sendfile

Rails' send_file has a beautiful, simple interface. Unfortunately, it ties up your Rails process with the rather mundane task of reading a file from disk. ....

There’s this slick HTTP header called “X-Sendfile” that Apache and Lighttpd support. It was made to address this kind of problem (isn’t that convenient?). Now, when you send an HTTP response, all you have to do is tack on an X-Sendfile header with the path of the file you need to send — don’t worry about actually reading the file or sending any of those bytes yourself. The web server will load the file you specified and send it downstream.

This is loads easier on your Rails process (it just sets the headers and gets on with life), and you get all the cool file transfer functionality already baked into your web server (like proper caching, resuming, etc). Of course, you can send any file that the web server can read, not just files in your normal public directory. This makes it perfect for sending private or protected content to specific users of your app.

ruby script/plugin install http://john.guen.in/svn/plugins/x_send_file/

usage

x_send_file('/path/to/file')
x_send_file('/path/to/image.jpg', :type => 'image/jpeg', :disposition => 'inline')
x_send_file('/path/to/file/', :header => 'X-LIGHTTPD-SEND-FILE')

Akcije #11

Izmjenjeno od Ernad Husremović prije više od 17 godina

http://tangent.org/528/myhttp_engine.html

projekti:
  1. mod_auth_useragent
  2. mod_filter
  3. mod_index_rss
  4. mod_layout
  5. mod_memcached
  6. mod_methods (
  7. mod_mp3
  8. mod_random
  9. mod_relocate
  10. mod_repository
  11. mod_text2html
  12. mod_trigger
Akcije #12

Izmjenjeno od Ernad Husremović prije više od 17 godina

mod_methods je baš koristan modul za učenje

Akcije #13

Izmjenjeno od Ernad Husremović prije više od 17 godina

file:///data/devel/apache/libapache2-mod-python-3.3.1/doc-html/index.html

Akcije #15

Izmjenjeno od Ernad Husremović prije više od 17 godina

http://www.bright-interactive.com/python/

We've been using Python, MySQL, Apache and mod_python for some time now and have developed a framework which makes development easier. This framework takes care of:
  • templating (using Cheetah)
  • querying MySQL (using Manager objects)
  • sending emails
  • debugging (to Apache log or stdout)
  • users and security
Akcije #16

Izmjenjeno od Ernad Husremović prije skoro 16 godina

  • Status promijenjeno iz Dodijeljeno u Odbačeno
Akcije

Također dostupno kao Atom PDF