Score:0

Apache2 server fails to start without sudo first time

ng flag

I have deployed my application to a kubernetes cluster that does not allow root user within pods. So I had to change the user to ubuntu. Due to this, I changed the default port of apache2 from 80 to 8080 as ports < 1024 are not allowed to be started without root access.

My issue is that when the apache2 server starts it throws the error

chown: changing ownership of '/var/lock/apache2.Ct3C4fV26c': Operation not permitted

So for testing this, I ran the image in local using docker run image:id.

In local docker container I noticed that this is happening only first time. When I start with normal user it fails but when I start with sudo first time, it runs:

sudo service apache2 start
second time onwards it starts without sudo.
service apache2 start

Please note that I am setting apt permissions before hand for my application usage like:

sudo chown -R ubuntu:ubuntu /var/lock/ sudo chown -R ubuntu:ubuntu /mnt/log/apache2/ sudo chown -R ubuntu:ubuntu /var/log/

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.