[Resolved] Custom Webmail App with mod_rewrite

jfreak53

Well-Known Member
Feb 29, 2008
61
0
56
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.
 

jfreak53

Well-Known Member
Feb 29, 2008
61
0
56
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 :(
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
San Francisco, CA
cPanel Access Level
Root Administrator
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 :(
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.
 

jfreak53

Well-Known Member
Feb 29, 2008
61
0
56
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.
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
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.
 

jfreak53

Well-Known Member
Feb 29, 2008
61
0
56
Well it's working now, but it's kicking out a 500 error:
SoftException in Application.cpp:357: UID of script "/usr/local/apache/htdocs/me.php" is smaller than min_uid
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.