Get apache linux user from php

I'm on a foreign linux system and need to determine the user that apache runs on (and so does php).

The aim: I need to get the owner of the script (this is no problem as I can use SplFileInfo) and compare it to the owner of the apache process.

I'm open to any alternative proposals.

Regards, Mario

Edit: Additional info:

The script is a thumbnail generator, that uses an XML file to generate thumbs from larger images. The script needs to create folders and write files. As I cannot influence the php configuration and I do not have any shell access, this has to be done very silently. The creation process stopps via exception and sends a mail on failue. As most of php's function cannot throw exceptions on failue, I need some manual checks to determine the environment I'm in. Therefore I need the apache user to compare it to some directory or fileowner.

Virtualhost For Wildcard Subdomain and Static Subdomain

I have an odd situation where I want to have the urls, and * all using a different virtual host. This is what I have (excluding cause it just makes it messier)

<VirtualHost *>

   DocumentRoot = /var/www/app1
   # Other configuration for this app here


<VirtualHost *>
   ServerAlias *

   DocumentRoot = /var/www/wildcard
   # other configuration for this app here


The problem is that they conflict. Whichever one is listed first wins out. How can I host both a wildcard virtualhost and a specific one?

Note: I'm not just changing DocumentRoot in the config, so using mod_rewrite to change the DocumentRoot variable does not fix it.


How to prevent browser page caching in Rails

Ubuntu -> Apache -> Phusion Passenger -> Rails 2.3

The main part of my site reacts to your clicks. So, if you click on a link, it will send you on to the destination, and instantly regenerate your page.

But, if you hit the back button, you don't see the new page. Unfortunately, it's not showing up without a manual refresh; it appears the browser is caching it. I want to make sure the browser does not cache the page.

Separately, I do want to set far-future expiration dates for all my static assets.

What's the best way to solve this? Should I solve this in Rails? Apache? Javascript?

Thanks for all your help, Jason

Alas. Neither of these suggestions forced the behavior I'm looking for.

Maybe there's a javascript answer? I could have rails write out a timestamp in a comment, then have the javascript check to see if the times are within five seconds (or whatever works). If yes, then fine, but if no, then reload the page?

Do you think this would work?

Thanks for all your help,