passenger-memory-stats works, passenger-config validate-install works fine, passenger-status says not running? - apache

Centos 7 server. Passenger installed with gem
As per title:
$ passenger-config validate-install
"Everything looks good :-)"
$ passenger-memory-stats
All the details of apache and passenger running.
I can go to the site and it works fine.
passenger-status output says "ERROR: Phusion Passenger doesn't seem to be running..."
I haven't customized any directories or done anything unusual up to this point that I'm aware of but passenger-status is apparently looking in the wrong place.
Suggestions on how to fix please?
Thanks

Related

apache2.4 , where to setup mod_ssl, dont see any mod_ssl.so file

Problem is the plain vanila apache is working, the moment I say sslEngine ON
it gives error, I am not able to find where any ssl setup is?
it does not create any log as well..
How this ssl setup is done? will copying a mod_ssl.so file from outside will work?
Apache version : 2.4.29
Os is RHEL 6.7
If this Red Hat documentation is not wrong the RHEL 6.x releases include Apache/2.2. Since you have Apache/2.4 I'd say you probably have an unofficial binary. Such binaries could of course have been installed in any conceivable way so this answer can easily be wrong. Yet making the hopefully safe assumption that you're still using the package manager and you just switched to a third-party repository you can try this:
yum install mod_ssl
Then tweak /etc/httpd/conf.d/ssl.conf to your liking and restart the service:
service httpd graceful
After a lot of research, I found below command which can help you show the actual issue while restarting. when I ran this it told me that .csr which I was using were wrong. I could not get this when I normally started the Apache but this command helped.
replace below with location where apache is installed and conf file is located, this will print the error ( if any).
/xxx/app/xxx/apache22/0/bin/apachectl_worker -DSSL -k start -f /xxx/app/xxx/apache22/0/conf/xxx.conf

Clear apache log or change log while apache is running

I want to clear my Apache log without stopping apache or anything like that, but I have a problem while apache's running I can not edit the active log file.
I attempted some solutions but all is not good, or it just does not work - for example:
cat /dev/null > /path/to/log.log
It works but it kills the CPU.
Now I want to know has anybody got a good solution for clearing log files or creating a new log file with a new name every N hours which doesn't kill the CPU,RAM,etc ...
What can I do? Please give me a solution :((
Kind regards.
Install and set up logrotate, assuming you are on a debian or ubuntu distribution do this :
$ sudu apt-get install logrotate
This is an "industry standard" solution for what you want to achieve.
Recommended reading:
http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-ubuntu-part-1
http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-centos-part-1
https://unix.stackexchange.com/questions/66292/learning-about-general-logging-logrotation-on-linux

Rails Reporting Wrong Environment in Multi-stage Setup

Using capistrano 2.12.0, capistrano-ext 1.2.1, Rails 3.2.7 and Phusion Passenger 3.0.15.
For no logical reason, my 'playground' server has started reporting that it's actually running in development mode.
I've reinstalled things, restarted apache etc but am still stuck.
Don't really want to hardcode as I've got a production environment to think about.
In my apache conf. I've set
RailsEnv playground
There's a gist of my deploy.rb file here
Capistrano is sending to the correct location etc. so I think it's rails or passenger rather than cap.
What else can I do to get this going properly??
---- EDIT ----
I've just tested with Unicorn and it's also reporting that it's running in development mode.
Starting unicorn with the following:
unicorn -E playground -l 8000
After much experimentation, I found the root cause to be a line in one of my models:
- if Rails.env = 'development'
Obviously, this should have been a '==' not a single one.

Phusion Passenger ngnix.conf location

I have a Rails 3 application that uses Phusion Passenger. I install the standalone version of Passenger using the command "gem install passenger" on my Macintosh MacBook Pro. The application works fine. Now, I want to change some configurations for the ngnix server but I can not find the location of the ngnix.conf file. I have looked in /usr/local and /opt/ and /etc/. Can someone assist me in either finding or creating the ngnix.conf?
Thanks
Look for the nginx.conf file in /opt/nginx/conf
You must have su privileges to edit this file.
Remember to stop and start nginx after making your changes

how to get trac to run with apache?

i have some problems getting trac to be running with apache.
have no idea of how to do and the tutorial i followed doesnt work.
http://trac.edgewall.org/wiki/TracModPython
i have an empty /etc/apache2/httpd.conf. should it be empty?
then i followed the tutorial and typed in:
LoadModule python_module modules/mod_python.so
so now it contains one row. i have ubuntu and i installed mod_python with:
apt-get install libapache2-mod-python libapache2-mod-python-doc
however, when i run a2enmod mod_python it says:
ERROR: Module mod_python does not exist!
but i have checked that it exists in /usr/lib/apache2/modules/mod_python.so.
so whats the problem?
Usually, installing mod_python via:
apt-get install libapache2-mod-python
will enable it. If it does not, the correct command is:
a2enmod python
note, the module is 'python', not 'mod_python'.
First, your httpd.conf may be empty, but you should also have a apache2.conf in the same directory that actually contains all the server directives.
As for the module, I was having the same issue and then did some digging. If you look in /etc/apache2/mods-enabled, you should have one in there called "python.load" (I do at least). If you open that up with vi, you will notice the following line in that file:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
I think that it may just be that its installed with a different name. If someone else knows different, I would be interested in hearing their views as well.
Regards,
Jeff