Avatar of AIX25
AIX25
Flag for United States of America asked on

AIX - Sudo rule setup to start/stop apache

/usr/local/apache/ is the path of Apache. It is currently owned by root. Please help me setup a sudo rule to start and sotp apache for specific users.
Unix OSApache Web Server

Avatar of undefined
Last Comment
woolmilkporc

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
woolmilkporc

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
AIX25

ASKER
For example, I need to add about 3 users to be able to run this sudo rule, i.e. user1, user2, and user3, and then a seperate group called apacheapp. How would this look?
SOLUTION
woolmilkporc

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
AIX25

ASKER
Ok, I will test it. What was the percent sign before the groupname for?
AIX25

ASKER
I can still stop and start apache with no issues using root. But, when I "su - user1", and try to run /usr/local/bin/apachectl start....I get the following error:

servername:/home/user1> /usr/local/apache/bin/apachectl start
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
servername:/home/user1>
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
woolmilkporc

1) The Percent sign indicates a Unix Group, instead of a userid.

2) How should the shell know about sudo? In my first comment I already wrote that your users must run:

sudo /usr/local/....
AIX25

ASKER
Oops, that is my mistake...I forgot to use sudo.
woolmilkporc

Don't worry! I saw this same mistake being made a hundred times here at EE ...
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.