Why is my apache running in 8080 started by root?
I am running Apache in 8080 port. After starting the httpd, I noticed that the parent process is owned by root.
[root@a ~]# ps -ef | grep httpd
root 13480 1 0 08:07 ? 00:00:00 /usr/sbin/httpd
apache 13505 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13506 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13507 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13508 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13509 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13510 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13511 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13512 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
[root@a ~]#
I saw below this post, but it says that by default, for the ports below 1024, root will start process.
If the apache works like this by default, where can I change this?
Thank you.
apache-httpd uid
add a comment |
I am running Apache in 8080 port. After starting the httpd, I noticed that the parent process is owned by root.
[root@a ~]# ps -ef | grep httpd
root 13480 1 0 08:07 ? 00:00:00 /usr/sbin/httpd
apache 13505 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13506 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13507 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13508 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13509 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13510 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13511 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13512 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
[root@a ~]#
I saw below this post, but it says that by default, for the ports below 1024, root will start process.
If the apache works like this by default, where can I change this?
Thank you.
apache-httpd uid
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
1
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Alright. I switched to another user and updated the permissions for/var/run/httpd/httpd.pid
and/var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?
– prado
Nov 9 '16 at 13:16
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
I am just trying to learn things. Just want to know from where exactly the launcher process gettingroot
as owner. Is it becauseroot
starting it?
– prado
Nov 11 '16 at 7:54
add a comment |
I am running Apache in 8080 port. After starting the httpd, I noticed that the parent process is owned by root.
[root@a ~]# ps -ef | grep httpd
root 13480 1 0 08:07 ? 00:00:00 /usr/sbin/httpd
apache 13505 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13506 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13507 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13508 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13509 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13510 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13511 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13512 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
[root@a ~]#
I saw below this post, but it says that by default, for the ports below 1024, root will start process.
If the apache works like this by default, where can I change this?
Thank you.
apache-httpd uid
I am running Apache in 8080 port. After starting the httpd, I noticed that the parent process is owned by root.
[root@a ~]# ps -ef | grep httpd
root 13480 1 0 08:07 ? 00:00:00 /usr/sbin/httpd
apache 13505 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13506 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13507 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13508 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13509 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13510 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13511 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
apache 13512 13480 0 08:11 ? 00:00:00 /usr/sbin/httpd
[root@a ~]#
I saw below this post, but it says that by default, for the ports below 1024, root will start process.
If the apache works like this by default, where can I change this?
Thank you.
apache-httpd uid
apache-httpd uid
edited Apr 13 '17 at 12:36
Community♦
1
1
asked Nov 7 '16 at 13:36
prado
420420
420420
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
1
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Alright. I switched to another user and updated the permissions for/var/run/httpd/httpd.pid
and/var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?
– prado
Nov 9 '16 at 13:16
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
I am just trying to learn things. Just want to know from where exactly the launcher process gettingroot
as owner. Is it becauseroot
starting it?
– prado
Nov 11 '16 at 7:54
add a comment |
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
1
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Alright. I switched to another user and updated the permissions for/var/run/httpd/httpd.pid
and/var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?
– prado
Nov 9 '16 at 13:16
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
I am just trying to learn things. Just want to know from where exactly the launcher process gettingroot
as owner. Is it becauseroot
starting it?
– prado
Nov 11 '16 at 7:54
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
1
1
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Alright. I switched to another user and updated the permissions for
/var/run/httpd/httpd.pid
and /var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?– prado
Nov 9 '16 at 13:16
Alright. I switched to another user and updated the permissions for
/var/run/httpd/httpd.pid
and /var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?– prado
Nov 9 '16 at 13:16
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
I am just trying to learn things. Just want to know from where exactly the launcher process getting
root
as owner. Is it because root
starting it?– prado
Nov 11 '16 at 7:54
I am just trying to learn things. Just want to know from where exactly the launcher process getting
root
as owner. Is it because root
starting it?– prado
Nov 11 '16 at 7:54
add a comment |
1 Answer
1
active
oldest
votes
https://www.thegeekstuff.com/2011/03/apache-hardening/
After this, if you restart apache, and do ps -ef, you’ll see that the apache is running as “apache” (Except the 1st httpd process, which will always run as root).
https://serverfault.com/questions/439307/apache-running-as-root-instead-of-user-specified-in-httpd-conf
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f321629%2fwhy-is-my-apache-running-in-8080-started-by-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
https://www.thegeekstuff.com/2011/03/apache-hardening/
After this, if you restart apache, and do ps -ef, you’ll see that the apache is running as “apache” (Except the 1st httpd process, which will always run as root).
https://serverfault.com/questions/439307/apache-running-as-root-instead-of-user-specified-in-httpd-conf
New contributor
add a comment |
https://www.thegeekstuff.com/2011/03/apache-hardening/
After this, if you restart apache, and do ps -ef, you’ll see that the apache is running as “apache” (Except the 1st httpd process, which will always run as root).
https://serverfault.com/questions/439307/apache-running-as-root-instead-of-user-specified-in-httpd-conf
New contributor
add a comment |
https://www.thegeekstuff.com/2011/03/apache-hardening/
After this, if you restart apache, and do ps -ef, you’ll see that the apache is running as “apache” (Except the 1st httpd process, which will always run as root).
https://serverfault.com/questions/439307/apache-running-as-root-instead-of-user-specified-in-httpd-conf
New contributor
https://www.thegeekstuff.com/2011/03/apache-hardening/
After this, if you restart apache, and do ps -ef, you’ll see that the apache is running as “apache” (Except the 1st httpd process, which will always run as root).
https://serverfault.com/questions/439307/apache-running-as-root-instead-of-user-specified-in-httpd-conf
New contributor
New contributor
answered 8 mins ago
hhr
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f321629%2fwhy-is-my-apache-running-in-8080-started-by-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
start apache with apache user not root.
– Ipor Sircer
Nov 7 '16 at 13:42
1
Saying root is normally able to open ports < 1014 is different than saying root is starting the process; you may call it with the user apache, you would have to edit the init file. However you may well break it, I suspect. The security mechanism of the privilege separation between the user root and apache exists for a reason.
– Rui F Ribeiro
Nov 7 '16 at 13:44
Alright. I switched to another user and updated the permissions for
/var/run/httpd/httpd.pid
and/var/run/httpd/httpd.pid
. Now it is starting with another user. I want to start httpd as root and have apache or another user as process owners. Is that possible?– prado
Nov 9 '16 at 13:16
Maybe you tell us what you actually want. Why does the httpd launcher process running as root bother you?
– countermode
Nov 10 '16 at 13:22
I am just trying to learn things. Just want to know from where exactly the launcher process getting
root
as owner. Is it becauseroot
starting it?– prado
Nov 11 '16 at 7:54