110 likes | 118 Views
The way in which a siteu2019s Apache web server software manages certain types of files and extensions is controlled by Apache handlers.
E N D
Table of Contents • How to Remove an Apache handler? • Modifying Static Content Using a CGI Script • Files with HTTP Headers • Apache Handlers • Built-in Handlers in Standard Distribution • Function of Apache Handlers • Creating an Apache Handler
Apache Handlers • A handler refers to an internal Apache representation of the action that is to be performed at the time when a file is called. Usually, files have implicit handlers, depending on the file type. Generally, the files are served by the server but there are certain types of files that are handled separately. • It is possible to configure handlers explicitly, depending on either filename extension or on location, without any relation to file type. • Handlers can either be included in a module or be built into the server, or these can be added with the Action directive.
Built-in Handlers in Standard Distribution The built-in-handlers in the standard distribution of cPanel are mentioned below. • default-handler - It sends the file and uses the default handler of Apache for static content. • send-as-is - It sends the file with HTTP headers intact. • cgi-script – It handles the file as a CGI script. • imap-file – It parses the file as an imagemap rule file. • server-info – It retrieves the configuration information of the server. • server-parsed – Parses the file for server-side includes. • server-status – It retrieves the status report of the server. • type-map – Parses the file as a type map file.
Function of Apache Handlers • Apache handlers control the way in which a site’s Apache web server software manages certain types of files and their extensions. CGI scripts and server-parsed files are handled by Apache. Apache can be configured for using an existing handler for the purpose of handling a new file type. For this purpose, you need to add manually the handler and the extension in the interface. • To digress, with regard to web servers, VPS (Virtual Private Servers) are in high demand due to the benefits that they offer. Professional web hosting companies, including HTS Hosting, provide Windows Managed VPS, Linux Managed VPS, Windows Self-Managed VPS, and Linux Self-Managed VPS.
1-800-123 -8156 Whoa! That’s a big number, aren’t you proud?
Creating an Apache Handler You need to carry out the following steps for adding an Apache handler: Enter the handler name in the text box, Handler. Enter the file extension in the text box, Extension(s). A file extension refers to the letters after the dot (.) in a file name. Space-separate multiple extensions. Click Add. It needs to be mentioned here that the interface does not let you create custom Apache handlers
How to Remove an Apache handler? You need to carry out the following steps in order to remove a user-defined handler: • Click Delete, that is under the Remove heading, for the appropriate handler in the User Defined Apache Handlers table. • Click Yes. It needs to be specified that you cannot remove those file extensions that are handled automatically by Apache.
Modifying Static Content Using a CGI Script The below-mentioned directives will result in the requests for files with the html extension to trigger the launch of the footer.pl CGI script. • Action add-footer /cgi-bin/footer.pl • AddHandler add-footer .html Post that, the CGI script has the responsibility of sending the document that was requested originally, which is pointed to by the PATH_TRANSLATED environment variable. It is also responsible for ensuring that the desired modifications or additions take place.
Files with HTTP Headers The send-as-is handler gets enabled by the following directives: <Directory "/web/htdocs/asis"> SetHandler send-as-is </Directory> The send-as-in handler processes all files in the /web/htdocs/asis/ directory, regardless of their filename extensions. .
Thanks! ANY QUESTIONS? www.htshosting.org