The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug in Virtual Host templating system ?

Discussion in 'General Discussion' started by bilsalak, May 4, 2008.

  1. bilsalak

    bilsalak Member

    Joined:
    Nov 26, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Apache 2.2.6


    I've installed mod_python and used the templating system to include the mod_python module into Apache via the pre-Virtual Host include.

    My goal requires that I add a few lines to the Virtual Host configuration to map the application to Python. Here is an example of what I'm doing:

    Code:
    <Directory /home/~owner~/public_html>
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /home/~owner~/public_html
        PythonOption TracUriRoot /
    </Directory>
    If place this code directly into the Virtual Host definition everything works as expected. If I move it to /usr/local/apache/conf/userdata/[ssl or std]/[1 or 2]/<something>.conf

    and run

    Code:
    /scripts/verify_vhost_includes --show-test-output
    I get

    Code:
    [TEST RESULTS]
    Syntax error on line 3 of /usr/local/apache/conf/userdata/std/1/developm/wirecollective.devtemple.com/vhost.conf.broken:
    Invalid command 'PythonHandler', perhaps misspelled or defined by a module not included in the server configuration
    [/TEST RESULTS]
    This has been driving me crazy. Is it a bug in WHM or am I missing something? Thanks in advance for any help.

    best,
    Bill
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Wrap the mod_python specific portions in <IfModule> blocks.
     
  3. bilsalak

    bilsalak Member

    Joined:
    Nov 26, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    thanks for the feedback cpanelkenneth.

    I added this to the /usr/local/apache/conf/userdata/[ssl or std]/[1 or 2]/<something>.conf

    Code:
    <IfModule mod_python.c>
    <Directory /home/~user~/public_html>
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /home/~user~/public_html
        PythonOption TracUriRoot /
    </Directory>
    </IfModule>
    and ran the

    Code:
    /scripts/verify_vhost_includes --show-test-output
    which told me everything was fine with that file. This is a major improvement. Then I ran

    Code:
    /scripts/ensure_vhost_includes --user=~user~
    and restarted apache. The expected output of having mod_python kick in and parse the Trac application did not work. When I add the

    Code:
    <IfModule mod_python.c>
    <Directory /home/~user~/public_html>
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /home/~user~/public_html
        PythonOption TracUriRoot /
    </Directory>
    </IfModule>
    directly to httpd.conf in the appropriate Virtual Host directive then everything works as expected. Do you see anything I missed or know of a way to further debug this issue ? I feel a bit stuck by not knowing the service manager as well as I should.

    Best,
    Bill
     
Loading...

Share This Page