Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I've got a working mod_perl installation on Ubuntu 10.O4. I've done the following things to get it working.

First i've created a file "/etc/apache2/site-available/yoursite" with following configuration:"

<VirtualHost *:80> ServerName yoursite ServerAdmin webmaster@localhost DocumentRoot /var/www/yoursite PerlModule ModPerl::Registry <Location /> SetHandler perl-script PerlResponseHandler ModPerl::Registry Options +ExecCGI </Location> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, c +rit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost>

Note that i create a virtual host with a given name. To make sure that the site is visible, add a following line in your "/etc/hosts":

127.0.0.1 yoursite.localdomain yoursite

Now create the directory "/var/www/yoursite", make sure it is readable by user "www-data", and create a file "test.pl" with following content:

use Apache2::RequestUtil; my $r = Apache2::RequestUtil->request; $r->content_type("text/html"); $r->print("mod_perl rules!");

Note i've removed the "$r->send_http_header" line. It is not a valid method anymore under mod_perl2.

Restart your apache server.

This should give, when going to "http://yoursite/perl.pl", the text "mod_perl rules!".

Hope this helps.

Kind regards

Martell


In reply to Re: How to configure mod_perl? by martell
in thread How to configure mod_perl? by rifat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2022-08-09 22:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?