How do I figure out what user & group Apache is running as?

前端 未结 2 1908
一整个雨季
一整个雨季 2021-01-12 16:37

On DreamHost shared hosting, I\'m setting up htpasswd, but Apache does not have permission to read the file. How do I give it permission? I want to either change the owner o

相关标签:
2条回答
  • 2021-01-12 17:05

    Actually, you don't need access to httpd.conf:

    ps aux | grep apache2
    groups apache_user
    

    should yield what You want

    0 讨论(0)
  • 2021-01-12 17:05

    I was having some issue that leads me to another solution. But it only works when you have access to the configuration file

    We can actually check the user and group in \etc\apache2\envars file. This is where Apache set the environments var and use it across application.

    Look for this two lines:

    export APACHE_RUN_USER=www-data
    export APACHE_RUN_GROUP=www-data
    

    Note this is just setting environment variables. The actual setting the apache to run as what user/group is actually in the \etc\apache2\apache2.conf

    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    

    The location of the files might me different but you should get the idea.

    0 讨论(0)
提交回复
热议问题