Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MIME Types for Perl

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi. I'm just trying to work out something. At the moment I have a clean install of WebMin, apache, PHP, perl etc. I'm wondering how i need to associate the .pl and .cgi files to Perl. I know it has something to do with the MIME types, but i cant work out what they are, and where i need to add them.

Anyone got any ideas? :(

Thanks

Andy
 
Hi,













For cgi scripts you don't need mime types - you designate extensions as being 'handled' by mod_cgi via the 'AddHandler' directive. You don't do anything special for any of the various scripting languages you can use (at least on linux!) such as perl or bash. As long as they work ouside of Apache they should be OK under cgi. It is somewhat of a convention to use the extension of .cgi irrespective of the language of the script itself although you can use .pl or whatever. So for 'basic' perl scripting you'd just have :













AddHandler cgi-script .cgi .pl













In addition you need to have something like the following for your cgi-bin directory :













ScriptAlias /cgi-bin/ "/var/












and an equivalent Directory container :













<Directory &quot;/var/





AllowOverride None






Options ExecCGI






Order allow,deny






Allow from all






</Directory>




















You can use mime times together with the 'Action' directive to force stuff through a cgi script, however :













Action text/html /var/












For PHP it's different and you do use mime types :













AddType application/x-httpd-php .php .php4













you also need the following :













LoadModule php4_module modules/libphp4.so













AddModule mod_php4.c













The relative path to the php module (or dll on windows) shown above as 'modules/libphp4.so' may be different on your system.



















That's it really as long as your permissions etc are OK on the files...












For mod_mime info see --> .












Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top