简体   繁体   中英

lighttpd service started with root privilege instead of the user set in the server.username

In my ubuntu box I created a user "lighttpd" and I modified the lighttpd.conf file with the created user, below are the lines modified.

server.username = "lighttpd" server.groupname = "lighttpd"

I am a root user, and started the lighttpd service by executing with my conf file located in /run folder like below. /usr/sbin/lighttpd -f /run/lighttpd.conf

On executing the above command, the lighttpd started with root user instead of lighttpd user.

My expectation was the service should start with lighttpd user (which was set server.username = "lighttpd" in conf file).

Run lighttpd with the -p flag to print the configuration that lighttpd sees, and then verify that what lighttpd sees matches what you think lighttpd should see. If lighttpd.conf contains server.username = "lighttpd" , then lighttpd will exit with an error if lighttpd can not drop privileges to become user lighttpd .

In your case, review the output of: /usr/sbin/lighttpd -f /run/lighttpd.conf -p Then, make sure that any other instance of lighttpd running on your machine has been shut down before you try manually starting lighttpd. (You can run multiple instances of lighttpd on different ports, but for your experiment, it is simpler to ask you to make sure all other instances of lighttpd have been shut down.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM