mod_actions
Module Apache mod_actions để thi hành CGI Script dựa theo kiểu file truy cập hoặc theo phương thức truy vấn đến (GET, POST, PUT ...). Module này giúp Apache có thêm chỉ thị Action, Script
Chỉ thị Action
Cấu hình chạy CGI theo kiểu file, cú pháp
Action action-type cgi-script [virtual]
action-type là 1 kiểu MIME được thêm vào nhờ module mod_mime bằng thỉ thị AddType như image/jpeg
cgi-script vị trí của CGI Script
virtual thêm vào để loại bỏ Handler phía trước
Ví dụ:
# Chạy image.cgi khi mở file .gif Action image/gif /cgi-bin/images.cgi # Mở .php bằng php.cgi AddHandler my-file-type .php Action my-file-type "/cgi-bin/php.cgi" # Thiết lập một Handler mới trong Virtual Host <Location "/news"> SetHandler news-handler Action news-handler "/cgi-bin/news.cgi" virtual </Location>
Chỉ thị Script
Chạy CGI dựa theo phương thức gửi đến, ví dụ:
Script POST "/cgi-bin/postcontent.cgi"
