LINUX CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
BackTrack 3.0 / 4.0
Pre-Final

5,487
Ubuntu 9.10
4,487
VLC 1.0.3
3,388
Wine 1.0.1 / 1.1.32
2,824
Yahoo Messenger
1.0.4

2,483
Adobe Flash Player
for Linux 10.0.32.18

2,320
Thunderbird PST
Import plugin 1.2

2,290
Mandriva Linux
2010.0

1,992
Super Grub Disk
0.9799

1,577
Yellow Dog Linux 6.2
1,441

WEEK'S BEST

  • Ubuntu 9.10
  • Ubuntu Netbook Rem...
  • Pidgin 2.6.3
  • Wine 1.0.1 / 1.1.32
  • Linux Kernel 2.6.3...
  • Mozilla Firefox 3....
  • Fedora 11
  • OpenOffice.org 3.1.1
  • Firestarter 1.0.3
  • The Gimp 2.6.7 / 2...
  • FileZilla 3.2.8.1 ...
  • Transmission 1.76
  • Super Grub Disk 0....
  • Gufw 9.04.2
  • Skype 2.0.072 / 2....
  • openSUSE Linux 11....
  • Opera 10.01 / 10.1...
  • Adobe Flash Player...
  • wine-doors 0.1.3
  • Google Gadgets 0.1...
  • Home / Linux / Internet / HTTP (WWW)

    mod_sed 0.1

    Download button

    No screenshots available
    Downloads: 226  Add to download basket  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dominic Mitchell | More programs
    The Apache License 2.0 / FREE
    April 13th, 2008, 10:22 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Add a review  Refer to a friend  Subscribe

     

    mod_sed description

     

    mod_sed is an Apache module that embeds a copy of the sed command.

    mod_sed is an Apache module that embeds a copy of the sed command. This means that you can automatically filter data without having to spawn a CGI process.

    It probably doesn't have a lot of practical use, but I wrote it anyway. The main purpose was for me to learn how to write an apache module.

    Requirements:

    · Apache

    BUILDING

    To build, you should just be able to type in "make". I'm still working on the portability aspects of this module, so it might not run on your system yet. All patches appreciated.

    You'll need apxs(8) to build this module, because at present, I don't understand Apache's static configuration (again, patches welcome). Either edit the Makefile to specify the location of it, or put it on the command line like this:

    % make APXS=/usr/local/sbin/apxs

    If your system doesn't have an fgetln(3) call (to test, see if "man fgetln" returns anything), you'll also have to uncomment a line in the Makefile.

    To install, "make install" should copy the mod_sed.so to your data directory and put the correct lines in your httpd.conf to enable it.

    TESTING

    This is all the documentation you get until I write some more, I'm afraid.

    You'll need: A directory or file that you want to run sed over inside Apache. In my case, this is "/usr/local/www/data/sed/". Copies of the files are in the "eg" subirectory. The httpd.conf fragment I used looked like this:

    < Directory /usr/local/www/data/sed >
    SetHandler sed-handler
    SedExtendedRegex on
    #SedProgram "s/foo/BAR/g"
    SedProgram /usr/local/www/data/sedscr
    SedPathMap /foo /usr/local/www/data/sedscr.foo
    < /Directory >


    You'll need to make sure that the directory you specify is visible from Apache. In fact, it's probably a good idea to do that /before/ installing this module...

    The important bit to activate mod_sed is the "SetHandler" line. That enables all files under that directory to be passed through mod_sed.

    The "SedExtendedRegex" line asks that sed use Enhanced Regexes instead of basic ones. If you don't know what that means, always include this line. For more details on the differences between basic regexes and extended regexes see re_format(7).

    The "SedProgram" keyword can specify either a whole sed program (like you would give on the command line with -e) or a pathname to a file containing a sed program (this is generally the preferred option). To determine between the two, mod_sed will attempt to see if a file by that name exists, otherwise it'll try and compile it as a program.

    The last command, "SedPathMap" takes two arguments: a PATH_INFO and another SedProgram argument. What it means is that when somebody requests a file:

    http://my.server/sed/index.html/foo

    The sed program in /usr/local/www/data/sedscr.foo will get run instead of the default in SedProgram. This can be very handy for serving up alternative versions of files.

      


    TAGS:

    embed sed | Apache module | filter data | Apache | sed | embedded



    HTML code for linking to this page:


    Go to top

    Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM