Compiling Apache2 on Ubuntu Recipe

Once you have finished installing Ubuntu Server 16.04 LTS,

  1. Login using the credentials you set during installation.
  2. In your home directory (cd ~), download the Apache 2.4 source code from the course website with:
    wget http://jwdittrich.people.ysu.edu/CSIS_1525/httpd-2.4.23.tar.gz
  3. Download the build-apache shell script from the course website with:
    wget http://jwdittrich.people.ysu.edu/CSIS_1525/build-apache.sh
  4. Give yourself permissions to execute the shell script:
    chmod u+x build-apache.sh
  5. Run the script as su:
    sudo ./build-apache.sh
  6. Create the /var/www directory:
    sudo mkdir /var/www
  7. Edit the configuration of the Apache2 main configuration file:
    sudo nano /usr/local/apache2/conf/httpd.conf
  8. Uncomment the line:
    LoadModule deflate_module modules/mod_deflate.so
    This allows the server to send pages to the browser compressed (saves your bandwidth/data cap)
  9. Find the User and Group lines to change the owner of the process to www-data:
    #User daemon
    #Group daemon
    User www-data
    Group www-data
  10. Find the DocumentRoot and Directory lines to change "/usr/local/apache2/htdocs" to "/var/www"
  11. Write output (^O) and close the file
  12. Create a basic index.html file in /var/www/:
    sudo nano /var/www/index.html
  13. go to the apache2 bin directory so you can run apachectl (apache control):
    cd /usr/local/apache2/bin/
    sudo apachectl start
  14. Now check to see if your webpage is live!
    lynx 127.0.0.1 or lynx localhost
  15. TODO: compile and install PHP