Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 43

Thread: How do i install & configure perl on ubuntu 8.10 apache2

  1. #21
    Join Date
    Sep 2008
    Location
    Windsor,CT
    Beans
    538
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    I think what you want is the following (whether you use two separate files or place them both in one file in sites-enabled folder should not matter):

    Site One:
    Code:
    <VirtualHost *>
    ServerAdmin webmaster@OurSite1.com
    ServerName www.OurSite1.com
    ServerAlias OurSite1.com
    	
    	DocumentRoot /var/www/OurSite1/
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/OurSite1/>
    		Options Indexes FollowSymLinks MultiViews
    		AllowOverride None
    		Order allow,deny
    		allow from all
    	</Directory>
    
    	<Directory /var/www/OurSite1/cgi-bin/>
    		AllowOverride None
    		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    		Order allow,deny
    		Allow from all
    	</Directory>
    
    	ErrorLog /var/log/apache2/error_site1.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog /var/log/apache2/access_site1.log combined
    	ServerSignature Off
    
    </VirtualHost>
    Site 2:
    Code:
    <VirtualHost *>
    ServerAdmin webmaster@OurSite2.com
    ServerName www.OurSite2.com
    ServerAlias OurSite2.com
    	
    	DocumentRoot /var/www/OurSite2/
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/OurSite2/>
    		Options Indexes FollowSymLinks MultiViews
    		AllowOverride None
    		Order allow,deny
    		allow from all
    	</Directory>
    
    	<Directory /var/www/OurSite2/cgi-bin/>
    		AllowOverride None
    		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    		Order allow,deny
    		Allow from all
    	</Directory>
    
    	ErrorLog /var/log/apache2/error_site2.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog /var/log/apache2/access_site2.log combined
    	ServerSignature Off
    
    </VirtualHost>
    You will thus now have to actually create the folders /var/www/Oursite1/cgi-bin/ and /var/www/Oursite2/cgi-bin/ and place your cgi scripts in their respective folders.

    You have to also remove the following from the end of /etc/apache2/apache2.conf:
    Code:
    <Directory /var/www/ourSite1/cgi-bin/>
    Options ExecCGI
    </Directory>
    The directory index should already include htm/html and it is actually set in /etc/apache2/mods-enabled/dir.conf

    Hope that helps...

  2. #22
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    ju2wheels, thank you

    I made the changes you suggested and
    Hello World worked. (http://www.oursite1.com/test.pl)

    With my html form action set to:http://www.OurSite1.com/formmail.pl
    when the form is submitted, we get the Internal Server Error message
    the bottom line is:
    Apache 2.2.8 (Ubuntu)mod_perl/2.0.3 Perl/v5.8.8 Server at www.OurSite1.com Port 80

    With my html form action set to: http://www.OurSite1.com/cgi-bin/formmail.pl
    when the form is submitted, we get the file not found screen

    do you have any more suggestions?

    once again, thank you for your help and your patience

    edit: added: /var/log/messages "Mar 12 15:26:12 webserver -- MARK --"
    Last edited by Genesis427; March 12th, 2009 at 08:42 PM.

  3. #23
    Join Date
    Sep 2008
    Location
    Windsor,CT
    Beans
    538
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    What folder did you place formmail.pl in? Both test.pl and formmail.pl should be in /var/www/Oursite1/cgi-bin/.

    Example:

    A file /var/www/Oursite1/test.html can have a form:

    Code:
    ....
    
    <form action="cgi-bin/formmail.pl">
    ....
    </form>
    ......
    Then that invokes the cgi file /var/www/Oursite/cgi-bin/formmail.pl which should process the input and print an HTML page in return.
    Last edited by ju2wheels; March 12th, 2009 at 09:10 PM.

  4. #24
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    progress
    now with the form action set to :http://www.oursite1.com/cgi-bin/formmail.pl, we get the Internal Server Error screen.

    That should indicate that there is an issue within my formmail script, correct?

    here is the beginning of the formmail script:

    Code:
    #!/usr/bin/perl -wT
    
    #
    
    # NMS FormMail Version 3.14c1
    
    #
    
    
    
    use strict;
    
    use vars qw(
    
      $DEBUGGING $emulate_matts_code $secure %more_config
    
      $allow_empty_ref $max_recipients $mailprog @referers
    
      @allow_mail_to @recipients %recipient_alias
    
      @valid_ENV $date_fmt $style $send_confirmation_mail
    
      $confirmation_text $locale $charset $no_content
    
      $double_spacing $wrap_text $wrap_style $postmaster 
    
      $address_style
    
    );
    
    
    
    # PROGRAM INFORMATION
    
    # -------------------
    
    # FormMail.pl Version 3.14c1
    
    #
    
    # This program is licensed in the same way as Perl
    
    # itself. You are free to choose between the GNU Public
    
    # License <http://www.gnu.org/licenses/gpl.html>  or
    
    # the Artistic License
    
    # <http://www.perl.com/pub/a/language/misc/Artistic.html>
    
    #
    
    # For help on configuration or installation see the
    
    # README file or the POD documentation at the end of
    
    # this file.
    
    
    
    # USER CONFIGURATION SECTION
    
    # --------------------------
    
    # Modify these to your own settings. You might have to
    
    # contact your system administrator if you do not run
    
    # your own web server. If the purpose of these
    
    # parameters seems unclear, please see the README file.
    
    #
    
    BEGIN
    
    {
    
      $DEBUGGING         = 1;
    
      $emulate_matts_code= 0;
    
      $secure            = 1;
    
      $allow_empty_ref   = 1;
    
      $max_recipients    = 5;
    
      $mailprog          = '/usr/sbin/sendmail -t';
    
      $postmaster        = '';
    
      @referers          = qw(www.oursite1.com);
    
      @allow_mail_to     = qw(info@oursite1.com);
    
      @recipients        = ();
    
      %recipient_alias   = ();
    
      @valid_ENV         = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
    
      $locale            = '';
    
      $charset           = 'iso-8859-1';
    
      $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
    
      $style             = '/css/nms.css';
    
      $no_content        = 0;
    
      $double_spacing    = 1;
    
      $wrap_text         = 0;
    
      $wrap_style        = 1;
    
      $address_style     = 0;
    
      $send_confirmation_mail = 0;
    
      $confirmation_text = <<'END_OF_CONFIRMATION';
    
    From: info@oursite1.com
    
    Subject: form submission
    
    
    
    Thank you for your form submission.
    
    
    
    END_OF_CONFIRMATION
    
    
    
    # You may need to uncomment the line below and adjust the path.
    
    # use lib './lib';

  5. #25
    Join Date
    Sep 2008
    Location
    Windsor,CT
    Beans
    538
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    Yes most likely. As I stated in one of the previous posts, sendmail is not setup correctly by default on Ubuntu and you have to install and configure exim for it to work.

    If a simple test file like /var/www/Oursite1/cgi-bin/test.pl containing this:
    Code:
    #!/usr/bin/perl -wT
    
    print "<html><head><title>Test</title></head><body><h1>It Works</h1></body></html>";
    If that works when you visit http://oursite1.com/cgi-bin/test.pl and you see "It works" in the browser then you are done configuring cgi and its working properly and any errors now are a result of your code.

  6. #26
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    ju2wheels,

    thank you for your help

    test.pl coded as one would the helloworld.pl script works from http://www/oursite1.com/cgi-bin/test.pl

    So, tomorrow, I will install and configure exim

    Once again, thank you

  7. #27
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    I have installed and configured exim4.
    Likely I have configured it improperly.

    When submitting the form the Internal Server Error is:
    Code:
    close sendmail pipe failed, mail prog=(/usr/sbin/exim4 -t) at (eval 8) line 216

  8. #28
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    I changed:
    Code:
    $mailprog          = '/usr/sbin/exim4 -t'; to $mailprog          = '/usr/sbin/exim4 t- i-';
    and my thanks page came up in the browser.

    No email was sent, so I still have something to repair.

  9. #29
    Join Date
    Sep 2008
    Location
    Windsor,CT
    Beans
    538
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    You dont need to use exim directly like that as the syntax is most likely different. The benefit to using exim is that it creates a symbolic link and pretends to be the old school sendmail. So the original mailprog command should work once you have exim configured properly. You can test if its setup properly by googling for command line sendmail for instructions on how to send an email from the command line and test it by sending an email to yourself manually.

    So I would try $mailprog = '/usr/sbin/sendmail -t -i'.

    A second thing to be aware of, is depending on your firewall (if you are in a corporate setting or potentially even your web host), you may need to use an authenticated SMTP in order for mail to reach people outside of the network your server is on.
    Last edited by ju2wheels; March 13th, 2009 at 04:52 PM.

  10. #30
    Join Date
    Mar 2009
    Beans
    30

    Re: How do i install & configure perl on ubuntu 8.10 apache2

    ju2wheels,

    thank you

    I will make the changes and give it a test soon

Page 3 of 5 FirstFirst 12345 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •