litespeedtech / litespeedtech/openlitespeed
Ownership and Mode of Virtual Host Log files
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 233
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 5
Description
I have created a virtual host and configured the logs as "Own Log File" with the path `$VH_ROOT/logs/error.log` of the vhost log and `$VH_ROOT/logs/access.log` of the access log.
OpenLiteSpeed is executed as `lsws:lsws` (user : group). The generated log files get the following owner and mode. Obviously the owner is set explicitly, because the group owner is also set to `lsws`, although the folder `logs` has the *setgid* bit set.
```
root@test-webserver:/vhosts/test1# touch logs/test-touched-by-root
root@test-webserver:/vhosts/test1# ls -al logs/
total 27
drwxr-s--- 2 lsws test1 5 Jun 12 17:39 ./
drwxr-x--- 5 root test1 6 Jun 11 23:49 ../
-rw-r--r-- 1 lsws lsws 177087 Jun 12 17:43 access.log
-rw-r--r-- 1 lsws lsws 0 Jun 11 01:24 error.log
-rw-r--r-- 1 root test1 0 Jun 12 17:39 test-touched-by-root
```
Is it possible to define a *umask* for the log files?
My wish of the owner and the mode for the log files is:
* for the **owner**: the group owner should not be set explicitly, so that the group owner is automatically taken over by the *setgid* bit of the folder. By the owning user `lsws` OpenLiteSpeed still has full read and write permissions.
* for the **mode**: So that not for others read rights exist, the *umask* should be able to be set.
```
-rw-r----- 1 lsws test1 access.log
-rw-r----- 1 lsws test1 error.log
```
Are there ways to configure this?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the OpenLiteSpeed configuration and virtual-host log-file creation paths; the issue does not name specific files or tests. Verify how the configured log paths set ownership and permissions, then confirm that a configurable umask or inherited setgid group produces the requested owner and mode for access.log and error.log.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100