Configure the /etc/rc.d/init.d/httpd script file

Configure your /etc/rc.d/init.d/httpd script file to start and stop Apache Web Server. Create the httpd script file, touch /etc/rc.d/init.d/httpd and add:

      #!/bin/sh
      #
      # Startup script for the Apache Web Server
      #
      # chkconfig: 345 85 15
      # description: Apache is a World Wide Web server.  It is used to serve \
      #	       HTML files and CGI.
      # processname: httpd
      # pidfile: /var/run/httpd.pid
      # config: /etc/httpd/conf/httpd.conf

      # Source function library.
      . /etc/rc.d/init.d/functions

      # See how we were called.
      case "$1" in
      start)
      echo -n "Starting httpd: "
      daemon httpd -DSSL
      echo
      touch /var/lock/subsys/httpd
      ;;
      stop)
      echo -n "Shutting down http: "
      killproc httpd
      echo
      rm -f /var/lock/subsys/httpd
      rm -f /var/run/httpd.pid
      ;;
      status)
      status httpd
      ;;
      restart)
      $0 stop
      $0 start
      ;;
      reload)
      echo -n "Reloading httpd: "
      killproc httpd -HUP
      echo
      ;;
      *)
      echo "Usage: $0 {start|stop|restart|reload|status}"
      exit 1
      esac

      exit 0

Now, make this script executable and change its default permissions:

        [root@deep ]/# chmod 700  /etc/rc.d/init.d/httpd

Create the symbolic rc.d links for Apache with the command:

        [root@deep ]/# chkconfig --add httpd

Start your new Apache server manually with the following command:

        [root@deep ]/# /etc/rc.d/init.d/httpd start

        Starting httpd:                                            	[  OK  ]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s