Hi Guys,

I've been looking a place to get more knowledge on PERL/Apache interaction and this seems a good place to start.

This is not an actual problem "per se" more like a good-to-have "feature" in my current environment.

I have my Apache running Perl with CGI and virtualhosts, each virtualhost has it's own cgi directory and different apps runnin on them... but there seems to be a catch, each time the perl script call the warn function it prints to the main Apache error log file and not on virtualhost error log file, do you know why? or how can I can change the stdout? Is it something I need to configure in Apache? Any advise on this guys?

UPDATE: Let me give you the details, I'm running Apache 2.2.15 compiled with MPM Worker, and I'm using mod_cgid. Here is the virtualhost template that I'm using:
<VirtualHost 0.0.0.0:443> ServerName privatedomain.com:443 DocumentRoot "/opt/apache/secure-htdocs" DirectoryIndex index.phtml index.php index.html index.htm ErrorLog /opt/apache/logs/privatedomain.com_error_log TransferLog /opt/apache/logs/privatedomain.com_access_log #### SSL Settings SSLEngine On SSLProtocol All -SSLv2 -SSLv3 SSLCertificateFile /opt/apache/conf/ssl.crt/privatedomain.com.c +rt SSLCertificateKeyFile /opt/apache/conf/ssl.key/privatedomain.com.k +ey SSLCACertificatePath /opt/apache/conf/ssl.crt SSLCACertificateFile /opt/apache/conf/ssl.crt/ca-bundle.crt SSLCipherSuite !ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+E +XP:+eNULL SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 <FilesMatch "\.(cgi|pl|shtml|php|phtml|php3?)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "/opt/apache/secure-htdocs"> Options All Order Allow,Deny Allow from All </Directory> ScriptAlias /cgi-bin/ /opt/apache/secure-cgi-bin/ <Directory "/opt/apache/secure-cgi-bin" > AllowOverride AuthConfig Limit Options Order Allow,Deny Allow from All </Directory> </VirtualHost>

In reply to Apache Perl CGI and VirtualHosts by thedevopsguy

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.