[SOLVED] mod_perl prints error 500 right on web page


 
Thread Tools Search this Thread
Top Forums Web Development [SOLVED] mod_perl prints error 500 right on web page
# 1  
Old 10-31-2011
[SOLVED] mod_perl prints error 500 right on web page

only happens with mod_perl (AddHandler perl-script)
with AddHandler cgi-script all is fine

for some reason it adds this html-code on my error page:

Quote:
<h1>OK</h1>
<p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p>
<p>Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.</p>
<p>More information about this error may be available in the server error log.</p>
it's just like php-error report
it happens when user does a mistake in form he gets error page
when i use cgi-method there's just error message and when mod_perl there's error message + this code


grrr
4 hours i was stuck with this and now got answer
it's because of 'die' function in the end of error message sub!
exit; - works fine

Last edited by radoulov; 11-01-2011 at 06:38 AM.. Reason: Marked as solved.
tip78
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

nmon and web page !

nmon and web page ! Is there any way to let nmon be configured with external Web Page and updating the same web page to be graphic monitoring. Pls advice ... (1 Reply)
Discussion started by: Mr.AIX
1 Replies

2. UNIX for Dummies Questions & Answers

Looking for a web page that won't let me in

Hi, I have a project for school using wget and egrep to locate pattern locations on a web page. One of the things we have to do is handle an "access denied" exception. Here is the problem, I can not think of/find any web pages that give me an access denied error to play with, can anyone suggest... (1 Reply)
Discussion started by: njmiano
1 Replies

3. UNIX Desktop Questions & Answers

Get a web page through CLI

Is there a way we can get a web page through CLI on a unix machine? Please help! (3 Replies)
Discussion started by: Pouchie1
3 Replies

4. UNIX and Linux Applications

Error While installing Mod_perl

Hi All, I am installing mod_perl in my machine but getting some error below is the procedures which I followed for installing the mod_perl Step1 : perl Makefile.PL MP_APR_CONFIG=/usr/local/apache2/bin/ asked for apache path given : /usr/local/apache2 Step2: make Step 3: make test In... (2 Replies)
Discussion started by: jacknicolson
2 Replies

5. Programming

fetching a web page in C

Hello, I'm a total newbie to HTTP commands, so I'm not sure how to do this. What I'd like is to write a C program to fetch the contents of a html page of a given address. Could someone help with this? Thanks in advance! (4 Replies)
Discussion started by: rayne
4 Replies

6. UNIX for Dummies Questions & Answers

Make a Web page

I'm 13 years of age and I am into computers. I am trying to learn how to make a webpage. I could use the help and I would greatly appriciate it. (1 Reply)
Discussion started by: lydia98
1 Replies

7. UNIX for Dummies Questions & Answers

how do i make a web page

hey uhh this is my first post and i was wondering how do i make a web page for like a small business or something anything will help thanks (3 Replies)
Discussion started by: Neil Peart
3 Replies

8. UNIX for Dummies Questions & Answers

Accessing Web Page

Hello, I am new to unix, but wanted to know how can we fetch data from a web page (i.e. an HTML Page), my requirement is to read an html page and wanted to create a flat file (text file) based on the contents available in the mentioned HTML page. Thanks Imtiaz (3 Replies)
Discussion started by: Imtiaz
3 Replies

9. UNIX for Dummies Questions & Answers

making a web page

Hey im new to unix! I am tryin to create a web page in unix and have done it all but when i try and load it it says permission denied!?> i have chmod a+rx for folder and file to make sure but still permissions wont let me?! any ideas can anyone do a quick run through of how to make a web page... (4 Replies)
Discussion started by: shashora
4 Replies

10. UNIX for Dummies Questions & Answers

Web page hosting

I built my website based on Dreamweaver, on Windows platform. My server uses Unix, and the page doesn't look too good. Is there any way to solve this problem without too much of a headache? (1 Reply)
Discussion started by: PCL
1 Replies
Login or Register to Ask a Question
Catalyst::Manual::Deployment::Apache::mod_perl(3pm)	User Contributed Perl Documentation    Catalyst::Manual::Deployment::Apache::mod_perl(3pm)

NAME
Catalyst::Manual::Deployment::Apache::mod_perl - Deploying Catalyst with mod_perl mod_perl Deployment The recommended method of deploying Catalyst applications is FastCGI. In many cases, mod_perl is not the best solution, but we'll list some pros and cons so you can decide for yourself. Pros Speed mod_perl is fast, and your entire app will be loaded in memory within each Apache process. Shared memory for multiple apps If you need to run several Catalyst apps on the same server, mod_perl will share the memory for common modules. Cons Memory usage Since your application is fully loaded in memory, every Apache process will be rather large. This means a large Apache process will be tied up while serving static files, large files, or dealing with slow clients. For this reason, it is best to run a two-tiered web architecture with a lightweight frontend server passing dynamic requests to a large backend mod_perl server. Reloading Any changes made to the code of your app require a full restart of Apache. Catalyst does not support Apache::Reload or StatINC. This is another good reason to run a frontend web server where you can set up an "ErrorDocument 502" page to report that your app is down for maintenance. Cannot run multiple versions of the same app It is not possible to run two different versions of the same application in the same Apache instance because the namespaces will collide. Cannot run different versions of libraries If you have two different applications which run on the same machine, and each application needs a different versions of a library, the only way to do this is to have per-vhost perl interpreters (with different library paths). This is entirely possible, but nullifies all the memory sharing benefits that you get from having multiple applications sharing the same interpreter. Setup Now that we have that out of the way, let's talk about setting up mod_perl to run a Catalyst app. 2. Install Apache with mod_perl Both Apache 1.3 and Apache 2 are supported, although Apache 2 is highly recommended. With Apache 2, make sure you are using the prefork MPM and not the worker MPM. The reason for this is that many Perl modules are not thread-safe and may have problems running within the threaded worker environment. Catalyst is thread-safe however, so if you know what you're doing, you may be able to run using worker. In Debian, the following commands should get you going. apt-get install apache2-mpm-prefork apt-get install libapache2-mod-perl2 3. Configure your application Every Catalyst application will automagically become a mod_perl handler when run within mod_perl. This makes the configuration extremely easy. Here is a basic Apache 2 configuration. PerlSwitches -I/var/www/MyApp/lib PerlModule MyApp <Location /> SetHandler modperl PerlResponseHandler MyApp </Location> The most important line here is "PerlModule MyApp". This causes mod_perl to preload your entire application into shared memory, including all of your controller, model, and view classes and configuration. If you have -Debug mode enabled, you will see the startup output scroll by when you first start Apache. Also, there have been reports that the block above should instead be (but this has not been confirmed): <Perl> use lib '/var/www/MyApp/lib'; use MyApp; </Perl> <Location /> SetHandler modperl PerlResponseHandler MyApp </Location> For an example Apache 1.3 configuration, please see the documentation for Catalyst::Engine::Apache::MP13. Test It That's it, your app is now a full-fledged mod_perl application! Try it out by going to http://your.server.com/. Other Options Non-root location You may not always want to run your app at the root of your server or virtual host. In this case, it's a simple change to run at any non- root location of your choice. <Location /myapp> SetHandler modperl PerlResponseHandler MyApp </Location> When running this way, it is best to make use of the "uri_for" method in Catalyst for constructing correct links. Static file handling Static files can be served directly by Apache for a performance boost. DocumentRoot /var/www/MyApp/root <Location /static> SetHandler default-handler </Location> This will let all files within root/static be handled directly by Apache. In a two-tiered setup, the frontend server should handle static files. The configuration to do this on the frontend will vary. Note the path of the application needs to be stated explicitly in the web server configuration for this recipes. AUTHORS
Catalyst Contributors, see Catalyst.pm COPYRIGHT
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-20 Catalyst::Manual::Deployment::Apache::mod_perl(3pm)