开发者

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

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 w开发者_运维知识库rite 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?


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"


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.


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜