Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Nov 2004
    Posts
    6

    Default Bug in Virtual Host templating system ?

    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. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by bilsalak View Post
    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
    Wrap the mod_python specific portions in <IfModule> blocks.

  3. #3
    Member
    Join Date
    Nov 2004
    Posts
    6

    Default

    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

Similar Threads & Tags
Similar threads

  1. Virtual host
    By pinehead in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-11-2007, 09:56 PM
  2. Creating a new virtual host
    By cacathcart in forum New User Questions
    Replies: 2
    Last Post: 10-25-2006, 07:33 AM
  3. Virtual Host
    By zaqizaba in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-20-2005, 11:18 AM
  4. Virtual host problem
    By dedms in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-09-2005, 08:28 AM
  5. mailman & virtual host
    By newfield in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 06-20-2002, 08:13 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube