Run httpd as a user (Windows)

5,840

Apache on windows runs as a service, so the user (and group?) are configured as part of the service definition. These can be configured as on the Logon tab for the Apache service.

Strange as it may seem there is also some information about Apache on windows on the Apache site.


You should also take a moment to familiarise yourself with the generally excellent Apache documentation for each directive. So for example if you had read the <IfModule> information you would have perhaps understood the stanza you quote better, and in particular the meaning of the ! ...

Share:
5,840

Related videos on Youtube

IEnumerable
Author by

IEnumerable

PHP Web developer with some experience in C#, WinForms and ASP.NET. Currently using PyroCMS and codeignighter Languages (PHP, Codeignighter, C#, ASP, CSS3, HTML5 and Javascript, Silverlight)

Updated on September 18, 2022

Comments

  • IEnumerable
    IEnumerable over 1 year

    Im running httpd as a Network Service on a Windows Server 2008 R2 machine. I want to make this run as a User for enhanced security.

    I was looking through the httpd.conf file and I noticed these lines

    <IfModule !mpm_netware_module>
    <IfModule !mpm_winnt_module>
    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.  
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User daemon
    Group daemon
    
    </IfModule>
    </IfModule>
    

    How do I set this up ? It also looks like I dont have the module mpm_netware_module or mpm_winnt_module set up either.

  • IEnumerable
    IEnumerable over 10 years
    thanks, Im trying to learn as much of these directives and modules as I can. It is starting to all come together... very slowly :/