Determining which user is executing my Apache app?
On my Ubuntu server with apache2/rails 3.0.3 I'd like to know which user runs my app.
Documentation and a lot of sources on the net says that the owner of config/environnement.rb is the one running the app.
If I ps -aux|grep apache
, I can only see process开发者_JAVA技巧es with www-data
as the owner. There is no passenger or ruby or rails processes.
How can I know for sure which user is running my rails app?
Use ps aux | grep -i passenger
or if that doesn't result in anything, ps aux | grep -i /application/directory/
If it's running as a passenger app, this will return the Passenger processes. Specifically, you'll probably be looking for Passenger ApplicationSpawner: /your/app/public/
It looks like rack may change the process name of your rails processes. Mine show up as "Rack: /path/to/app". Try ps -ef | grep Rack
.
Try ps aux | grep -i rails
instead.
Update
Heh, a flood of answers, cam reminded me - if you have a config.ru
then your app will be a rack application. If not then it'll be a rails application. So either his or mine will work for you.
精彩评论