Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create Directories - You need to create a directory that will contain your apache configuration files, logs, html files, and cgi/php scripts. In this example, we will use a directory named httpd in your home directory but you can use any name you like.

    Code Block
    $ mkdir ~/httpd
    $ cd ~/httpd
    $ mkdir html conf conf.d conf.modules.d logs cgi-bin run
    $ ln -s /usr/lib64/httpd/modules modules 
    $ cp /etc/httpd/conf.d/php.conf ~/httpd/conf.d/
    $ cp /etc/httpd/conf.modules.d/* ~/httpd/conf.modules.d/
  2. Create Configuration File - You will need an apache configuration file and we have provided one you can use as a starting point. You can copy that file with:

    Code Block
    $ cp /etc/httpd/conf/httpd.conf.template ~/httpd/conf/httpd.conf
    

    Please note that this template file is only available on burrow.soic.indiana.edu (aka. silo) so you must be logged into that system when you run this cp command.

    Once you have copied this file, you MUST edit the file and make the following substitutions:

    • Replace all occurances of the string "USERNAME" with your real username.
    • Replace all occurances of the string "GROUP" with your primary group. You can get this by running groups at a command prompt and you want to use the first group listed. If you are a student, you should use "students".
    • Replace the string "PORTNUMBER" with the port number your server will use. Please see the Server KB Document for information about choosing and registering your port number.
    • If you used a directory other than ~/httpd from step 1, you will have to make the appropriate edits to change that as well.
  3. Starting and Stopping the Server - You can now start and stop apache by running the httpd command using the -f flag to specify the location of your configuration file. You can start the server with:

    Code Block
    $ /usr/sbin/httpd -f ~/httpd/conf/httpd.conf -k start
    

    You can stop the server with:

    Code Block
    $ /usr/sbin/httpd -f ~/httpd/conf/httpd.conf -k stop
    

    If you make configuration changes, you can restart the server with:

    Code Block
    $ /usr/sbin/httpd -f ~/httpd/conf/httpd.conf -k restart
    

...