• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to configure apache to recognize perl scripts?

 
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I'm trying to get my perl programs to execute on my browser.
I've installed LAMP and I went through a few tutorials on how to configure apache2 to execute perl but none of them have helped me.
I went through this topic: http://httpd.apache.org/docs/2.2/howto/cgi.html
I'm getting the source code of my program as the output in my browser.
I tried to edit the httpd.conf file but the file seems to be empty and it was read only so i had change permissions using chmod.
Please help!
Thanks in advance!!
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What distribution of Linux do you have? (e.g. Ubuntu, Redhat, etc.)

I suspect you haven't found the correct config file yet. If the httpd.conf you edited was empty before, that's the wrong one.

On my distribution (Ubuntu) the config file is /etc/apache2/apache2.conf
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using elementary os(built on ubuntu 12.04)
I tried to edit the apache2.conf file.
Eventhough it wasn't empty I couldn't find any of the commands (like ScriptAlias or LoadModule) that are listed in the link I posted above.
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a list of the files I have in the "/etc/apache2/"
apache2.conf envvars magic mods-enabled sites-available
conf.d httpd.conf mods-available ports.conf sites-enabled
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ashwin Rao wrote:I'm using elementary os(built on ubuntu 12.04)
I tried to edit the apache2.conf file.
Eventhough it wasn't empty I couldn't find any of the commands (like ScriptAlias or LoadModule) that are listed in the link I posted above.



You have to edit the file and add those. So for instance if your Perl scripts are in /usr/local/apache2/cgi-bin/, they should be treated as a CGI script, not a web page.

ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/

If your script is called myscript.pl then the URL would look like this:

http://mydomain.net/cgi-bin/myscript.pl
 
reply
    Bookmark Topic Watch Topic
  • New Topic