EasyApache Passenger/htaccess issues
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
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
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.
So anyone knows what's the recommended way to get this properly working with .htaccess ? Thanks in advance
PassengerAppEnv "development"
PassengerEnabled on
PassengerBaseURI "/testapp"
PassengerAppRoot "/home/testuser/testapp"
PassengerAppGroupName "testuser - testapp"
Allow from all
Options -MultiViews
Options -Indexes
Require all granted
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
Alias /testapp /home/testuser/crm/public
PassengerAppEnv "development"
PassengerEnabled on
PassengerBaseURI "/testapp"
PassengerAppRoot "/home/testuser/testapp"
PassengerAppGroupName "testuser - testapp"
Allow from all
Options -MultiViews
Options -Indexes
Require all granted
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.
PassengerAppEnv "development"
PassengerEnabled on
PassengerBaseURI "/"
PassengerAppRoot "/home/testuser/testapp"
PassengerAppGroupName "placem13 - testapp"
Allow from all
Options -MultiViews
Options -Indexes
Require all granted
So anyone knows what's the recommended way to get this properly working with .htaccess ? Thanks in advance
-
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 /etc/redhat-release:CentOS Linux release 7.6.1810 (Core) /usr/local/cpanel/version:11.76.0.12 /var/cpanel/envtype:virtuozzo CPANEL=release0 -
Hello @supcp, It's by design that attempts to configure Passenger directives in .htaccess files is disallowed as a security precaution. You should instead use the following UAPI function to manage Ruby applications for user accounts: UAPI Functions - PassengerApps::edit_application - Developer Documentation - cPanel Documentation Let me know if there's a specific scenario or use-case where the above UAPI function doesn't address the configuration needs of your application. Thanks! 0
Please sign in to leave a comment.
Comments
2 comments