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:

      # 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/
      # config: /etc/httpd/conf/httpd.conf

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

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

      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  ]

Leave a Reply

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

You are commenting using your 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