EasyApache Passenger/htaccess issues

supcp

Registered
Dec 7, 2018
4
0
1
EU
cPanel Access Level
Website Owner
Hello,

I'm trying to deploy a Rails Application in a server with Cpanel&WHM 76.0 (build 12), and EasyApache installed with the following packages "Apache 2.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, and Ruby 2.4". EasyApache 4 says is "up to date"

I'm having issue getting .htaccess inside my rails/public app to be propertly read.

When creating an application through "Application Manager" in cpanel i get this apache configuration inside /etc/apache2/conf.d/userdata/std/2_4/ folder

Code:
<Location "/testapp">
    <IfModule mod_passenger.c>
        PassengerAppEnv "development"

        PassengerEnabled on
        PassengerBaseURI "/testapp"
        PassengerAppRoot "/home/testuser/testapp"
        PassengerAppGroupName "testuser - testapp"
    </IfModule>
</Location>
<Directory "/home/testuser/testapp">
    Allow from all
    Options -MultiViews
    Options -Indexes
    Require all granted
</Directory>
Although this launch the rails application, it doesn't read .htaccess file (where i have for example PassengerRuby directive).

If I add to the application conf file the Alias directive, it seems it seems to read .htaccess
Code:
Alias /testapp /home/testuser/crm/public
<Location "/testapp">
    <IfModule mod_passenger.c>
        PassengerAppEnv "development"

        PassengerEnabled on
        PassengerBaseURI "/testapp"
        PassengerAppRoot "/home/testuser/testapp"
        PassengerAppGroupName "testuser - testapp"
    </IfModule>
</Location>
<Directory "/home/testuser/testapp">
    Allow from all
    Options -MultiViews
    Options -Indexes
    Require all granted
</Directory>
But i get an error saying that PassengerRuby is not allowed in .htaccess
"/home/testuser/testapp/public/.htaccess: PassengerRuby not allowed here"

Although PassengerRuby is allowed in .htaccess context checking here Configuration reference - Apache - Passenger Library

I saw in /etc/apache2/conf.d/passenger.conf file that there is a PassengerDisableHtaccess, a property from EasyApache and not from Passenger, but disabling (and rebuilding http.conf with /scripts/rebuildhttpdconf, etc) didn't change anything, htaccess is not read (without the Alias directive), or improperly read (with the error i say).

I also don't get htaccess read if trying to deploy the app to root path (instead of subpath /testapp) with this configuration.
Code:
<Location "/">
    <IfModule mod_passenger.c>
        PassengerAppEnv "development"

        PassengerEnabled on
        PassengerBaseURI "/"
        PassengerAppRoot "/home/testuser/testapp"
        PassengerAppGroupName "placem13 - testapp"
    </IfModule>
</Location>
<Directory "/home/testuser/testapp">
    Allow from all
    Options -MultiViews
    Options -Indexes
    Require all granted
</Directory>
So anyone knows what's the recommended way to get this properly working with .htaccess ?

Thanks in advance
 

supcp

Registered
Dec 7, 2018
4
0
1
EU
cPanel Access Level
Website Owner
I don't know why I can't edit my post, but i forgot to mention that i have root access to Cpanel/whm and ssh.

This is the ouput of grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf

Code:
/etc/redhat-release:CentOS Linux release 7.6.1810 (Core)
/usr/local/cpanel/version:11.76.0.12
/var/cpanel/envtype:virtuozzo
CPANEL=release
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363