Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have WAMP run httpd.exe as user [myself] instead of local SYSTEM?

Tags:

apache

wamp

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?

like image 759
Olivier H Avatar asked Apr 21 '10 14:04

Olivier H


2 Answers

Win+R, services.msc

edit wampapache and wampmysqld to log on as some user.

the tray icon is a convenient front end to "net start wampapache" and "net start wampmysqld"

like image 136
xPi Avatar answered Oct 15 '22 10:10

xPi


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.

like image 36
Justin Garrick Avatar answered Oct 15 '22 09:10

Justin Garrick