Apache with built in Perl?

Hi,
I tried to configure the built in Apache to run perl/cgi scrips, but obviously I am missing some settings ...
Apache Version is
Server version: Apache/2.2.11 (Unix)
Server built: Feb 3 2009 01:54:45
To get cgi scripts running, I added to httpd.conf
AddHandler cgi-script .cgi .pl
AddHandler server-parsed .html
changed the directory from
#<Directory "/Library/WebServer/Documents">
to
<Directory "/Users/Domi/Sites">
and added ExecCGI to the Options
Options Indexes FollowSymLinks MultiViews ExecCGI
But it looks like that I missed some settings, as it still does not work. Safari shows the text of the perl script, but does not execute it.
Any ideas what else could be missing?
Thanks

Hi,
I am fairly new to perl and cgi and all that jazz. I am currently using my idisk "Sites" folder to host my web-site. I am trying to create a script for file upload, however I have a script but whenever I test it, it downloads a copy of the script onto my computer from the website. I am wondering if you can help me fix it. This is my cgi script and it is fed by a normal html <form>
#!/usr/bin/perl -wT
use strict;
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
use File::Basename;
$CGI::POST_MAX = 1024 * 5000;
my $safefilenamecharacters = "a-zA-Z0-9_.-";
my $upload_dir = "/Site/cgi-bin/upload/";
my $query = new CGI;
my $filename = $query->param("photo");
my $email_address = $query->param("email_address");
if ( !$filename )
print $query->header ( );
print "There was a problem uploading your photo (try a smaller file).";
exit;
my ( $name, $path, $extension ) = fileparse ( $filename, '\..*' );
$filename = $name . $extension;
$filename =~ tr/ /_/;
$filename =~ s/[^$safefilenamecharacters]//g;
if ( $filename =~ /^([$safefilenamecharacters]+)$/ )
$filename = $1;
else
die "Filename contains invalid characters";
my $upload_filehandle = $query->upload("photo");
open ( UPLOADFILE, ">$upload_dir/$filename" ) or die "$!";
binmode UPLOADFILE;
while ( <$upload_filehandle> )
print UPLOADFILE;
close UPLOADFILE;
print $query->header ( );
print <<END_HTML;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thanks!</title>
<style type="text/css">
img {border: none;}
</style>
</head>
<body>
Thanks for uploading your photo!
Your email address: $email_address
Your photo:
</body>
</html>
END_HTML

Similar Messages

  • Compiling Apache with PERL module on Solaris 8

    Hi there,
    After the Richard's reply, I found the Apache sources on the intallation CD 2/2. And after a while I successful compile the apache WITH ITS STANDARD modules with the following command:
    $ ./configure --prefix=/usr/apache \
    --enable-module=most \
    --enable-shared=max \
    --with-layout=Solaris
    $ make
    $ make install
    But the above "configure" does not compile the companion mod_perl. So, I tried:
    ... $ ./configure --prefix=/usr/apache \
    --enable-module=most \
    --enable-shared=/usr/src/apache/mod_perl/src/modules/perl/mod_perl.c \
    --add-module=max \
    --enable-shared=max \
    --with-layout=Solaris
    but the above command just copies the "mod_perl.c" to the diretory
    "usr/src/apache/src/modules/extra"
    missing the corresponding *.h
    Then trying
    $ make
    The compilation fails because of ALL the
    files on the directory
    /usr/perl5/5.00503/sun4-solaris/CORE
    are not found.
    Any Hint?
    Thanks in advance
    C�sar

    have you tried downloading the source from apache.org and compiling it?
    ive installed apache on sol8 many times, but all from apache.. not from the cd..
    alphademon.com

  • Using a different webcam with Intel iMac with built-in isight cam.

    Hi...I hope someone can shed some light on this.
    I have an intel core duo iMac 20 with built-in isight.
    I use Yahoo Messenger (the new version) and have no problems getting my isight to work with it.
    For most circumstances, the built-in isight is fine... but sometimes having a camera with a zoom feature and the ability to pan further up or down would be most beneficial.
    I also own a usb Logitech (pro-4000) webcam (the last series for which they have Mac support) and have installed the latest Mac drivers for it. I can get the Logitec to run its built-in applications, but when I try to select a webcam to use for Yahoo (in the yahoo preferences webcam section), the only selection available to me is the built-in isight.
    Is there any way to get the option to choose between the Logitech and the isight?
    Thanks for any help you can give me...
    Intel Core Duo iMac 20"   Mac OS X (10.4.7)   2GHz/2GB 256VRAM

    http://webcam-osx.sourceforge.net/
    macam driver and macam component installation resolves this issue

  • Problem with my brand new mp3 player Zen Stone Plus 2GB ( with built in speaker )

    Hi .
    I have purchased the following Zen Stone Plus 2GB with built in speaker on 24.06.2008.
    From day one, it had a charging problem . Initial charging it'snever go beyond 87%.
    After using it for 2 days, at the time of recharging , I found my player won`t get dectected in my PC .
    I took the set to the vendor for a checkup . He tried to solve it by resetting , formating etc. But he could only able to to format it's sacrificing its 50% of its allocated space.
    My vendor then changed the set with a brand new one, againts that faulty one .
    Now the new one worked well for 3 - 4 days , but it is now totally dead .
    But the set did not give any indication before it become completely dead.
    A few dust particles inside the LCD screen was also observed. I can`t understand how come dust particles can enter inside
    a player which is sealed box pack .
    Next issue is with the battery which CREATIVE promised of giving a backup of approx 20 hrs of continious playback , which with minimal scuffling and with minimal settings lasted for 0 hrs approx ( 50% less than promised ).
    Another thing that i must state is the problem of FM Reception . It is simply terrible . In the same area where my mobile's FM reception is fine , Zen Stone's FM failed to give any reception .
    I came to know about Zen Stone Plus from of my friend , who is using Zen Stone Plus GB without any problem for long time.
    Pls tell me what to do now, since my player is compleately out of order now , and pls suggest me something regarding the issue of battery backup , FM reception ... etc.
    Now i am in a total mess . I just dont know what to do with the set that is few days old .
    Pls help urgently .
    Waiting for any valued suggestion .
    Bye ...

    Hi,
    I would suggest getting in touch with support, they might be able to help you with this.
    Go to the Support section of the website and select your product. On your right, click on Contact Us. You will be provided with a list of troubleshooting options. Click on the one closes to your issue. Go through the suggestions and if the does not work or you have already tried that, scroll to the bottom and click on No, escalate to email. This should bring you to the email form to contact support.

  • The New Creative Zen Stone plus with built-in spea

    ?i was thinking of buying the the New Creative Zen Stone plus 2GB?with built-in speaker. http://creative.com/products/mp3/zenstoneplus/?The product detail info claim a 20 hours battery life of this product. . is?this a?true claim ?2. is there any problem about the charging process of this product?because the "previous" Creative?Stone Plus has a charging and?battery life problem. 3. Or should i just settle for the Creative muVo v00 2 GB instead ?Any thoughts guys?Thanks

    xmouse,
    Here you go:
    Firmware for Zen Stone Plus w/ Speaker
    You can find any other files you need by going to "Support" and then "Downloads" on this website.
    Good luck,
    Dale

  • UNSUPPORTED : The way it works Apache with OC4J via AJPV13 with mod_jk

    RDBMS Version: 8.1.7.x
    Operating System and Version: SUSE Linux 7.2 / Win NT/2k/XP
    Product (i.e., OAS, IAS, etc): 9ias 1.0.2.2 OC4J 9.0.2.0.0
    Product Version:
    JDK Version: 1.3.1
    Error number:
    UNSUPPORTED : The way it works Apache with OC4J via AJPV13 with mod_jk
    We dont want to use the lame and old mod_jserv so we want to use oc4j but in connection with Apache.
    This is like mod_oc4j in the Oracle 9ias Release 2
    This guide is for advanced users !
    Step-by-Step :
    1) get Tomcat 3.3 for linux or nt with Apache module mod_jk
    http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/bin/
    2) add mod_jk module to httpd.conf (9ias) and comment all mod_jserv, dms, oproc, ojsp ....
    LoadModule jk_module libexec/mod_jk.so
    Include mod_jk.conf
    3) edit mod_jk.conf
    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13 JkMount /servlets/* ajp13
    <Location "/WEB-INF/"> AllowOverride None
    deny from all
    </Location>
    3) edit workers.properties
    workers.tomcat_home=/opt/oracle/ias/oc4j/j2ee/home
    workers.java_home=/usr/java
    worker.list=ajp13
    worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13
    4) edit http-web-site.xml (oc4j)
    <web-site host="localhost" port="8009" protocol="ajp13" display-name="Oracle9iAS Containers for J2EE HTTP Web Site">
    5) start oc4j
    java -verbose -jar oc4j.jar
    6) start apache (look in error_log)
    apachectl startssl
    7) try to request a jsp page or servlet ..
    http://localhost:7777/test.jsp
    8) good luck it works fine .. !!
    Matthias Roth
    Technical Manager
    Z|rich Investmentgesellschaft mbH
    [email protected]

    Thanks for the tip Mathias, it's always good to see people trying out experimental things with the products.
    We're providing a new module (mod_oc4j) with our Oracle9iAS Release2 product to do this directly from the Oracle HTTP Server (Apache). We've re-written bits and pieces of the module to improve it's performance. Likewise, we've also integrated mod_oc4j with our HA story so it will be notified when new OC4J instances are brought online or if existing ones go down, enabling it to actively route requests around the available OC4J instances.
    Thanks again!
    -steve0

  • 20" Monitor with (Built-in iSight?)

    As soon as Apple updates the 20" monitor with built-in iSight I will be buying one and connecting my Macbook, then retiring my iMac iSight to my wife. Hurry up Apple with the upgrade.
    Now for the technical question:
    If Apple indeed adds iSight to it's line of monitors and since all the new computers Apple is building these days already have iSight built-in will my dream configuration work.
    I know the external iSight works when connected, however there are minor glitches when shutting down, sleeping....

    dig a little deeper next time
    D/FW, there nothing to dig for. You're asking for functionality and behaviour of a product that does not exist. You're better off speculating in a rumours forum.

  • USB Webcam on Macbook with built-in Isight?

    Has anyone been able to use an external webcam via USB on a Macbook with built-in iSight?
    This should be very straight-forward, but it's not working for me. Is it possible? Thanks.

    I have an older logitech 3000 and have been able to get it to work with 3rd party software such as macam and btvpro, but can't use it for Yahoo Messenger or similar programs. It won't work with photobooth either.

  • How to have Snow Leopard, Mavericks with built-in recovery, and Windows 7 (Bootcamp) on my iMac (Intel)?

    I would like to have Snow Leopard, Mavericks with built-in recovery, and Windows 7 (Bootcamp) on my iMac (Intel).  Is this possible?  If so, how?  Currently, I have Snow Leopard and Windows 7 (Bootcamp) running on my iMac.  I have enough disk space to split my Snow Leopard partition.  I have read that if I split my Snow Leopard partition, clone my Snow Leopard partition to the new partition, and boot to the new partition, that I may have problems with the Maverick's upgrade because it may not be able to create the recovery parition, or that it may erase the Windows partition, or that it may mess up the Windows boot process.

    Simplest is to install Mavs on an ext HD, using FW or TB. I don't do windoze, so can't advise about the Boot Camp and multiple volumes issue. Since there's no Boot Camp, I have four volumes running SL through Mavs.

  • Can u use a USB webcam on an iMac with built-in isight for Yahoo Messenge?

    Hi...I hope someone can shed some light on this.
    I have an intel core duo iMac 20 with built-in isight.
    I use Yahoo Messenger (the new version) and have no problems getting my isight to work with it.
    For most circumstances, the built-in isight is fine... but sometimes having a camera with a zoom feature and the ability to pan further up or down would be most beneficial.
    I also own a usb Logitech (pro-4000) webcam (the last series for which they have Mac support) and have installed the latest Mac drivers for it. I can get the Logitec to run its built-in applications, but when I try to select a webcam to use for Yahoo (in the yahoo preferences webcam section), the only selection available to me is the built-in isight.
    Is there any way to get the option to choose between the Logitech and the isight?
    I tried macam drivers, but that just gave me an application that allowed me to record video or snap pics from my Quickcam, Yahoo Messenger still does not recognize it as a source.

    http://webcam-osx.sourceforge.net/
    macam driver and macam component installation resolves this issue

  • Models with Built in Speakers

    It seems that the only iPod with built in speakers is the iPod Touch. Is this correct?

    If you want a speaker you either have to go for the iPod touch (all generations except the 1st gen) or the 5th generation iPod nano. (only the 5th gen includes a speaker - this model was sold from 2009 - 2010.)

  • Integrating Web server (eg Apache) with the application server

    I am thinking a project in which I use more static HTML files than JSPs. One way is to use an Apache server to display those HTML files (it should be faster), and deploy the JSPs into the J2EE server; another way is just simple to change the web container�s port to 80 (of the PE 8), and wrap all the files into a war file and deploy it into the application server.
    So can someone advise my which way is better? And if I use the first one, I�d like to know if it is the same way to integrate Apache with Tomcat.
    Thank you very much!

    In the past there has been a belief that the Apache web server serves static content faster than tomcat. Site managers would configure apache to deliver static content and integrate a web container to handle the dynamic content. I believe this argument is losing steam as tomcat gets better. I guess the only way you will know for sure is to deploy your application in PE 8.0 and then in an apache/web container configuration and do some benchmarking. I have no such benchmark data to compare and I base my comments on what I have read in newsgroups over the past months. Personally, I would opt for the app server only setup just to ease configuration. Others may have a different opinion.

  • Output required in MS Excel from Reports Oracle 10g error with built in pac

    Hi All,
    Our requirement is to get matrix report output in MS Excel. For that i found a report online. However, im having issues with Built-in Package OLE2.obj_type.
    Below is the report log file:
    ******* Custom: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XX_MATRIX_REPORT module: XX_MATRIX_REPORT
    Current system time is 10-AUG-2012 17:23:17
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    APPLLCSP Environment Variable set to :
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    Enter Password:
    REP-0736: There exist uncompiled program unit(s).
    REP-0736: There exist uncompiled program unit(s).
    REP-1247: Report contains uncompiled PL/SQL.
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-1247: There exist uncompiled program unit(s).
    REP-1247: Report contains uncompiled PL/SQL.
    Report Builder: Release 10.1.2.3.0 - Production on Fri Aug 10 17:23:19 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 11242010.
    Review your concurrent request log and/or report output file for more detailed information.
    Executing request completion options...
    Output file size:
    0
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 10-AUG-2012 17:23:20
    Please Help!!!

    After Report:
    function AfterReport return boolean is
    begin
    RPT2XLS.release_memory;
    srw.user_exit('FND SRWEXIT');
    srw.message(101,'After Report');
    return (TRUE);
    end;
    RPT2XLS package body:
    PACKAGE BODY RPT2XLS IS
         TYPE ExcelCell IS RECORD(RowNo binary_integer,
                                                                     ColNo binary_integer,
                                                                     Val varchar2(2000),
                                                                     FontName varchar2(20),
                                                                     FontSize binary_integer,
                                                                     FontStyle binary_integer,
                                                                     FontColor binary_integer,
                                                                     BgrColor binary_integer,
                                                                     Format varchar2(60),
                                                                     Align xlHAlign
         TYPE ExcelCells IS TABLE OF ExcelCell;
         Cell ExcelCells := ExcelCells();
         CurrentRow binary_integer := 1;
         PROCEDURE new_line IS
         BEGIN
              CurrentRow := CurrentRow + 1;
         END;
         PROCEDURE put_cell(ColNo binary_integer, CellValue in varchar2,
                                                      FontName in varchar2 DEFAULT null,
                                                      FontSize in binary_integer DEFAULT null,
                                                      FontStyle in binary_integer DEFAULT null,
                                                      FontColor in binary_integer DEFAULT null,
                                                      BgrColor in binary_integer DEFAULT null,
                                                      Format in varchar2 DEFAULT null,
                                                      Align in xlHAlign DEFAULT null
                                                      ) IS
         BEGIN
              Cell.Extend;
              Cell(Cell.Last).RowNo := CurrentRow;
              Cell(Cell.Last).ColNo := ColNo;
              Cell(Cell.Last).Val := CellValue;
              Cell(Cell.Last).FontName := FontName;
              Cell(Cell.Last).FontSize := FontSize;
              Cell(Cell.Last).FontStyle := FontStyle;
              Cell(Cell.Last).FontColor := FontColor;
              Cell(Cell.Last).BgrColor := BgrColor;
              Cell(Cell.Last).Format := Format;
              Cell(Cell.Last).Align := Align;
         END;
    PROCEDURE run IS
              Application OLE2.OBJ_TYPE;
              Workbooks OLE2.OBJ_TYPE;
              Workbook OLE2.OBJ_TYPE;
              Worksheets OLE2.OBJ_TYPE;
              Worksheet OLE2.OBJ_TYPE;
              WorkCell OLE2.OBJ_TYPE;
              WorkColumn OLE2.OBJ_TYPE;
    WorkFont OLE2.OBJ_TYPE;
    WorkInterior OLE2.OBJ_TYPE;
              ArgList OLE2.LIST_TYPE;
         BEGIN
              Application := OLE2.create_obj('Excel.Application');
              OLE2.set_property(Application, 'Visible', 1);
              Workbooks := OLE2.get_obj_property(Application, 'Workbooks');
    Workbook := OLE2.invoke_obj(WorkBooks, 'Add');
              Worksheets := OLE2.get_obj_property(Workbook, 'Worksheets');
              Worksheet := OLE2.get_obj_property(Application, 'ActiveSheet');
              for i in Cell.First .. Cell.Last
              loop
                   if Cell(i).Val is not null then
                        ArgList := OLE2.create_arglist;
                        OLE2.add_arg(ArgList, Cell(i).RowNo);
                        ole2.add_arg(ArgList, Cell(i).ColNo);
                        WorkCell := OLE2.get_obj_property(Worksheet, 'Cells', ArgList);
                        ole2.destroy_arglist(ArgList);
                        ole2.set_property(WorkCell, 'Value', Cell(i).Val);
                        ole2.set_property(WorkCell, 'NumberFormat', Cell(i).Format);
                        if Cell(i).Align is not null then
                             ole2.set_property(WorkCell, 'HorizontalAlignment', Cell(i).Align);
                        end if;
                        WorkFont := OLE2.get_obj_property(WorkCell, 'Font');
                        WorkInterior := ole2.Get_Obj_Property(WorkCell, 'Interior');
                        if Cell(i).FontName is not null then
                             OLE2.set_property(WorkFont, 'Name', Cell(i).FontName);
                        end if;
                        if Cell(i).FontSize is not null then
                             OLE2.set_property(WorkFont, 'Size', Cell(i).FontSize);
                        end if;
                        if mod(Cell(i).FontStyle, 2) = 1 then
                             OLE2.set_property(WorkFont, 'Bold', 1);
                        end if;
                        if mod(Cell(i).FontStyle, 4) > 2 then
                             OLE2.set_property(WorkFont, 'Italic', 1);
                        end if;
                        if mod(Cell(i).FontStyle, 8) > 4 then
                             OLE2.set_property(WorkFont, 'Underline', 2);
                        end if;
                        if Cell(i).FontColor is not null then
                             OLE2.set_property(WorkFont, 'ColorIndex', Cell(i).FontColor);
                        end if;
                        if Cell(i).BgrColor is not null then
                             OLE2.set_property(WorkInterior, 'ColorIndex', Cell(i).BgrColor);
                        end if;
                        OLE2.release_obj(WorkInterior);
                        OLE2.release_obj(WorkFont);
                        OLE2.release_obj(WorkCell);
                   end if;
              end loop;
              ArgList := ole2.create_arglist;
              ole2.add_arg(ArgList, 'A:Z');
              WorkColumn := ole2.Get_Obj_Property(WorkSheet, 'Columns', ArgList);
              ole2.destroy_arglist(ArgList);
              ole2.invoke(WorkColumn, 'AutoFit');
              OLE2.release_obj(WorkColumn);
              OLE2.release_obj(Worksheet);
              OLE2.release_obj(Worksheets);
              OLE2.release_obj(Workbook);
              OLE2.release_obj(Workbooks);
              OLE2.release_obj(Application);
         END;
         PROCEDURE release_memory IS
         BEGIN
              Cell := ExcelCells();
              SYS.DBMS_SESSION.free_unused_user_memory;
         END;
    END;
    We are getting the error in log file Report contains uncompiled PL/SQL.
    due to ole2.obj_type...

  • Has anyone successfully connected an AEBS to the new Panasonic TVs with built-in WiFi?  If so, please describe the requirements and process.  Thanks.

    Has anyone successfully connected an AEBS to the new Panasonic TVs with built-in WiFi?  If so, please describe the requirements and process.  (TV subscription is through DirecTV and ISP is TWC.)  Thanks.

    If you wish to use the cellular capabilities of a device, you will need a SIM (unless the carrier uses CDMA which doesn't use SIMs) and you will have to pay a cell carrier. No cell company provides service for free. The only way you will get free Internet is via WiFi to a free and open WiFi access point, as sometimes is offered in public buildings or by some businesses.
    Regards.

  • Integrating Apache with Tomcat?

    Anyone have a guide to integrating Apache with Tomcat using mod_jk?
    I followed some guides online, but they all seem really dated with some obscure references. This seems like it should be on the top of the list....

    Hi Alan.
    I've discovered the exact same problem.... 0.0.0.0 instead of 127.0.0.1
    You've obviously not had any replys here, but di you end up working it out on your own?

Maybe you are looking for