Goal: Apache Server runs on a http port and needs to be started/stopped as non-root user if Apache Server port is greater than 1024. How to make Apache server run as root user if port is less than 1024 in linux environment?
Solution:
Solution:
- Login as root user.
- Goto Apache directory say $ORACLE_HOME/Apache/Apache/bin
- Change ownership of apachectl as root chown root .apachectl
- Change permission as chmod 6750 .apachectl
Ack. Don't do that.
ReplyDeleteadd the user you want to be able to start Apache to sudoers and allow them to stop and start the httpd service.
Off the top of my head a line like:
fmwuser ALL=/sbin/service httpd start, /sbin/service httpd stop, /sbin/service httpd restart, /sbin/service httpd status
or if you don't want to be prompted for a password:
fmwuser ALL=NOPASSWD: /sbin/service httpd start, /sbin/service httpd stop, /sbin/service httpd restart, /sbin/service httpd status
Hi Anonymous,
ReplyDeleteThanks for your comments.
The details I mentioned in the post are used in general.
Touche. Outstanding arguments. Keep up the amazing work.
ReplyDeleteMy blog ; hostwinds terms and conditions