Compiling Apache2 on Ubuntu Recipe
Once you have finished installing Ubuntu Server 16.04 LTS,
- Login using the credentials you set during installation.
- 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 - Download the build-apache shell script from the course website with:
wget http://jwdittrich.people.ysu.edu/CSIS_1525/build-apache.sh - Give yourself permissions to execute the shell script:
chmod u+x build-apache.sh - Run the script as su:
sudo ./build-apache.sh - Create the /var/www directory:
sudo mkdir /var/www - Edit the configuration of the Apache2 main configuration file:
sudo nano /usr/local/apache2/conf/httpd.conf - 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) - 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 - Find the DocumentRoot and Directory lines to change "/usr/local/apache2/htdocs" to "/var/www"
- Write output (^O) and close the file
- Create a basic index.html file in /var/www/:
sudo nano /var/www/index.html - go to the apache2 bin directory so you can run
apachectl(apache control):
cd /usr/local/apache2/bin/
sudo apachectl start - Now check to see if your webpage is live!
lynx 127.0.0.1orlynx localhost - TODO: compile and install PHP