Phusion Passenger gives ERROR: not running on Ubuntu - ruby-on-rails-3

I'm trying to user Phusion Passenger to host my Rails 3 app from Ubuntu 11.04. I installed the passenger apache2 module and followed the instructions for editing my apache2.conf file and everything. I also restarted my apache server and I'm getting this:
Restarting web server apache2
[Tue Aug 09 10:41:36 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting [Tue Aug 09 10:41:37 2011] [warn] module passenger_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
I'm able to get to localhost/testapp but when I get there, instead of a rails app, I get an "index of /testapp" page with just the file system laid out. When I run the command passenger-status, I get this:
ERROR: Phusion Passenger doesn't seem to be running.
Any ideas?

There are probably multiple issues on your system, but this one is the most obvious:
[warn] module passenger_module is already loaded, skipping
This means you have two "LoadModule passenger_module ..." directives in your config files. The old one is probably stale and points to an older version of Phusion Passenger. You need to remove that or it'll cause conflicts.
The other one is probably related to filesystem permissions. The user that Apache runs as must be able to check whether the file 'config/environment.rb' and 'config.ru' exist in your app root, i.e. it must have executable permissions to the necessary directories and all parent directories.
The final possible issue is that you've set DocumentRoot to the application root, but you're supposed to set it to the 'public' directory.

Related

Internal Server Error after install 2.3.6 problem apache

I need help with the installation of Magento 2.3.6 this is returning an error in apache:
core: alert] [pid 23385] [client 179.232.122.240:2423] .htaccess: Invalid comid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
I already wasted a lot of time researching and tested a lot, but nothing worked, could someone help me?
Invalid comid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration
This implies you don't have mod_env installed in Apache. You need to install/enable this module and restart Apache.
This is a little unusual since mod_env is considered a "Base" module and is "compiled and loaded into the server by default".
Reference:
https://httpd.apache.org/docs/2.4/mod/mod_env.html
To find out which Apache modules are enabled, check #ValentinBajrami's answer to the following question on ServerFault:
To list apache loaded modules use:
apachectl -M
or:
apachectl -t -D DUMP_MODULES
or on RHEL,CentoS, Fedora:
httpd -M
And the following question if you need to install/enabled mod_env:
How to enable mod_env in Apache

Invalid command 'RemoteIPProxyProtocol' (httpd 2.4.6) when running httpd behind HAproxy in tcp mode

I'm trying to setup PROXY protocol between a HAproxy acting as a load-balancer (tcp mode) and httpd (2.4.6)running behind. The objective is to get the "real" client IP addresses on the httpd-side.
In haproxy.conf the keyword send-proxy has been put in the selected backend.
The line:
LoadModule remoteip_module modules/mod_remoteip.so
has been added to httpd config file.
The directive RemoteIPProtocolAddress On has been set in the httpd virtualhost configuration file.
However, when reloading/restarting httpd the following errors appears:
[root#XXXXXXXXX conf.d]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: enabled)
Active: failed
[...]
Invalid command 'RemoteIPProxyProtocol', perhaps misspelled ...
Looking at the mod_remoteip source code for httpd 2.4.6, it appears the directive RemoteIPProxyProtocol does not exist anymore.
I'm not sure to understand how the versioning works. For instance I can see the RemoteIPProxyProtocol directive exists in mod_remoteip 2.4.43 but not in mod_remoteip 2.4.0.
How can I workaround this issue ? E.g. compiling another mod_remoteip version ? Downgrading httpd? Other?
Thanks.
Happened to meet the same problem, and after checking the documentation:
RemoteIPProxyProtocol is only available in httpd 2.4.31 and newer
I'm currently running Apache/2.4.29 on Ubuntu 18.04 and Apache/2.4.41 on Ubuntu 20.04, it works with 2.4.41.

How to run apache as non-root, using non-standard ports?

I need to get apache running as a non-root user, listening to port 8443, in order to have a new website available (on localhost:8443) for internal security scanning, on a CentOS 7.3 system. I understand only the basics of apache (on Ubuntu), and I am NOT a web administrator, so am unfamiliar with the many options / config settings necessary to get this to work.
I have a directory (/webcontent) with my website content (which requires php), and can host there the various conf files necessary. But I am stumbling through getting httpd.conf setup properly for apache to run as a local user, launched with:
httpd -f /webcontent/conf/httpd.conf
And have set the logs to write to /webcontent/logs (via ErrorLog parameter), but it then complains about not having write access to /run/httpd, and so won't actually start:
[Thu Feb 23 11:59:51.289587 2017] [auth_digest:error] [pid 25464]
(13)Permission denied: AH01762: Failed to create shared memory segment
on file /run/httpd/authdigest_shm.25464
I imagine this is only the first of many problems I might have to get this running, so if anyone can point out the specific config settings necessary in httpd.conf (or elsewhere?) to get this scenario to work, that would be very much appreciated. Or has any other suggestions on running a non-root instance of apache for testing.
A bit late, but I see there's no answer so far. I just ran into this issue myself. My solution is below.
Use the DefaultRuntimeDir directive to override the default "/run/httpd" directory. This goes in httpd.conf. For example:
DefaultRuntimeDir "/my/local/rundir"
This will cause apache to create "/my/local/rundir/authdigest_shm.1234"
For some reason this doesn't also override the default pid file directory, so set it with the PidFile directive, e.g.:
PidFile "/my/local/rundir/httpd.pid"
You might also want to look at the ServerRoot directive.

gitorious gives permission denied on fresh bitnami setup , amazon ec2 instance using https

This is a brand new installation of a bitnami gitorius image on EC2, worked fine until i tried to enable https/ssl.
I am sure i have misconfigured apache somehow, however the root document at https://tarantula.anatexis.net loads just fine.
but if one goes to the gitorious app at https://tarantula.anatexis.net/gitorious you get permission denied.
which config file do I edit to allow https traffic to gitorious.
looking at the apache logs, is see this,
[Mon Jun 03 17:25:20 2013] [error] [client 71.17.13.29] Directory index forbidden by Options directive: /opt/bitnami/apache2/htdocs/gitorious/, referer:Https://tarantula.anatexis.net/
Any help would be appreciated, Thanks
Joe
OK, so i fixed it, found the file /opt/bitnami/apache2/conf/extra/httpd-ssl.conf this config file has the document root in it for ssl traffic, the default is wrong and it needs to be changed to
DocumentRoot "/opt/bitnami/apps/gitorious/htdocs/public"
This solved all my issues I believe.

MAMP Pro + Espionage folder encryption = 403 error?

I'm using MAMP PRO on my OS X 10.6 with Espionage to encrypt my ~/Sites folder (where MAMP is pulling my virtual hosts from).
I'm having trouble having MAMP's Apache follow the symlink that Espionage automatically creates to /Volumes/EspionageMounts/lee/3042560432 (I believe this changes all the time, so cannot be static).
My 'Sites' folder is owned by lee/staff.
The volume Espionage mounts seems to be owned by the same.
I have set MAMP Pro to use user 'lee' for Apache.
FollwSymLinks is set in my test.dev virtual host.
And yet, any Apache request to test.dev/whatever.html yields a 403 Forbidden.
The Apache error logs shows:
[Sun Jul 18 08:39:14 2010] [error]
[client 127.0.0.1] Symbolic link not
allowed: /Users/lee/Sites
What am I missing?
Make sure the target folder of the symlink has sufficient permissions for "others."
Try checking the option "Public mountpoint" on Espionage.
I had the same problem. You must select "Public mountpoint" under Espionage settings for your ~Sites folder. Click "Save Changes" and you should see your local sites properly when your folder isn't locked.