Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

EasyApache Passenger/htaccess issues

Discussion in 'EasyApache' started by supcp, Dec 7, 2018 at 12:10 PM.

Tags:
  1. supcp

    supcp Registered

    Joined:
    Friday
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. supcp

    supcp Registered

    Joined:
    Friday
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
    
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,411
    Likes Received:
    1,956
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice