tags:

views:

137

answers:

2

Hello!

I run a django application over apache with mod_wsgi, using WAMP.

A certain URL allows me to stream the content of image files, the paths of which are stored in database.

The files can be located whether on local machine or under network drive (\my\network\folder).

With the development server (manage.py runserver), I have no trouble at all reading and streaming the files.

With WAMP, and with network drive files, I get a IOError : obviously because the httpd instance does not have read permission on said drive.

In the task manager, I see that httpd.exe is run by SYSTEM. I would like to tell WAMP to run the server as [myself] as I have read and write permissions on the shared folder. (eventually, the production server should be run by a 'www-admin' user having the permissions)

Mapping the network shared folder on a drive letter (Z: for instance) does not solve this at all.

The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.

I've also regedited : I tried to duplicate the HKLM[...]\wampapache registry key under HK_CURRENT_USER\ and rename the original key, but then the new key does not seem to be found when I cmd this

> httpd.exe -n wampapache -k start

or when I run WAMP.

I've run out of ideas :)

Has anybody ever had the same issue?

+1  A: 

The User/Group directives in httpd.conf do not seem to have any kind of influence on Apache's behaviour.

httpd.exe is started by the root user (this is probably why you see it running under SYSTEM). The user and group lines in httpd.conf determine what user the child processes (that httpd spawns) will run under. These forks are what actually handle page requests, etc. so it is possible that your configuration is already doing what you want it to, it is just unclear from looking at task manager.

You could also try using runas to start WAMP/Apache, though your mileage may vary.

Segphault
OK, then maybe it's a syntax thing? My login is a windows domain login, any idea on how to formulate this in httpd.conf?
Olivier H
I've never tried it on Windows, but there are some instructions at http://httpd.apache.org/docs/2.0/platform/windows.html#winsvc. I think the part you're probably interested in starts with "By default, all Apache services are registered to run as the system"
Segphault
I'll try and check and understand what you linked thanks :)
Olivier H
A: 

I've just found that executing httpd.exe myself works for me... I just loose all the funky WAMP tray icon, and the "restart apache" menu item, really handy whenever I update my application code...

I'll have to make do with this for the moment...

Olivier H