Thursday, July 26, 2012

How to configure Apache Server with port less than 1024?

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:
  1. Login as root user.
  2. Goto Apache directory say $ORACLE_HOME/Apache/Apache/bin
  3. Change ownership of apachectl as root chown root .apachectl
  4. Change permission as chmod 6750 .apachectl

3 comments:

  1. Ack. Don't do that.

    add 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

    ReplyDelete
  2. Hi Anonymous,

    Thanks for your comments.
    The details I mentioned in the post are used in general.

    ReplyDelete
  3. Touche. Outstanding arguments. Keep up the amazing work.
    My blog ; hostwinds terms and conditions

    ReplyDelete