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.

[Resolved] Custom Webmail App with mod_rewrite

Discussion in 'cPanel Developers' started by jfreak53, Dec 18, 2013.

  1. jfreak53

    jfreak53 Well-Known Member

    Joined:
    Feb 29, 2008
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    I'm trying to setup a custom webmail app for port 2095 and 2096. Everything worked great in the testing phase when it was easy PHP. But the app we are trying to install there requires mod_rewrite. It seems that mod_rewrite doesn't work for anything on the webmail port.

    I figured I'd edit the vhost directive to AllowOverride All but I cannot find where this is defined at for those two ports.

    Any help on how to active mod_rewrite for the webmail ports host would be greatly appreciated. We are trying to install ownCloud there.

    Thanks.
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    Ports 2082,2083,2086,2087,2095, and 2096 all run under cPanel's webserver (cpsrvd) not Apache. There is no way that I'm aware of to use Apache modules with cpsrvd.
     
  3. jfreak53

    jfreak53 Well-Known Member

    Joined:
    Feb 29, 2008
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    Hmm, I did NOT know that :) interesting.

    Ok, I understand that. So does cpsrvd use htaccess files? I only ask as Roundcube uses one in it's directory. If not that is a major drawback of the system I think, web hosts cannot include scripts for their users that use htaccess at all :(
     
  4. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    There's no evidence that I can find which says that cpsrvd is using the .htaccess file. I don't see the expires header being modified as it would be from the Roundcube .hataccess:

    Code:
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    </IfModule>
    
    I also tried denying access:

    Code:
    <Directory />
    Order Deny,Allow
    Deny from all
    </Directory>
    
    and adding directives from a module I know is not loaded (mod_substitute):

    Code:
    <Location />
        AddOutputFilterByType SUBSTITUTE text/html
        Substitute "s|<BR */?>|<br />|i"
    </Location>
    
    None of the above had any effect on Roundcube.
     
  5. jfreak53

    jfreak53 Well-Known Member

    Joined:
    Feb 29, 2008
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    That's what I was afraid of :( I did that also but wanted someone else to try to make sure I didn't botch something.

    That's a major drawback.

    Does anyone know how to get PHP to work under the default port 80 for the server hostname? Directory /etc/httpd/htdocs. I could use that one, though I don't want to, but PHP scripts don't work there.
     
  6. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    I'm able to execute PHP under /etc/httpd/htdocs (alias for /usr/local/apache/htdocs) without issue.

    Check /usr/local/apache/conf/php.conf to make sure that you have something like:

    # LibPHP5 configuration
    LoadModule php5_module modules/libphp5.so
    AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml

    Also check the directives in httpd.conf related to /usr/local/apache/htdocs to make sure there is a VHost entry for your hostname/hostip and that some setting isn't disabling PHP.
     
  7. jfreak53

    jfreak53 Well-Known Member

    Joined:
    Feb 29, 2008
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    Well it's working now, but it's kicking out a 500 error:
    Makes no sense as all other files in that directory are root user owned also. After checking apache it is running as 'nobody'.

    - - - Updated - - -

    Huh, ok, so it runs if I make it's owner 'nobody' ha ha. Nice to know :) thanks. I'll try OC there instead.
     
Loading...

Share This Page