Apache Server

  1. To install Apache you first need to ensure that you have the most current repository. Use the command sudo apt-get update and provide your admin password.
  2. Next use the command sudo apt-get install apache2. You will be prompted to proceed with the install. Type y and press enter to continue.
  3. Install the Apache mod required to run PHP on your server by entering the command sudo apt-get install liabapache2-mod-php. You will be prompted to run the install. Type y and press enter to continue.
  4. Next enter sudo a2query -m php7.0.
  5. Enter the command sudo apt-get install mysql-server. You will be prompted to continue, press y and enter.
  6. Enter a password for the root user of MySQL.
  7. Enter the command sudo apt-get install phpmyadmin. You will be prompted to continue, press y and enter.
  8. Choose to reconfigure apache2, choose yes to configure PHP My Admin and choose a password.
  9. Navigate to /etc/apache2/sites-available.
  10. Copy the Apache2 default config. Folder and rename it after your site. Do this by entering sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/yoursite.conf. Replace yoursite with the name of your website. Do this for each site that you wish to have available on your server.
  1. Make sure that your working directory is /etc/apache2/sites-available. Enter the command sudo nano yoursite.conf to open the config file in a text editor.
  2. On line 8, remove the # and change www.example.com to www.yoursite.com. On line 9 type ServerAlias yoursite.com.
  3. Next to Document Root, change the file path to /var/www/html/yoursite.tbd. Press ctrl+x and type y to save. Press enter to confirm the file name.
  4. R epeat steps 11 to 13 for each configuration file that you created in step 10.










  1. Navigate to /var/www/html and create a folder for each site that you wish to enable. Do this by entering the command sudo mkdir yoursite.tbd­. In each folder create an index.html file.
  1. Change back to the root directory and enter the command sudo a2ensite yoursite.tbd. Do this for every site you wish to enable then enter the command service apache2 reload. Navigate to /etc/apache2/sites-enabled to confirm that all of the sites are enabled.
  1. Enter the command ifconfig and take note of your servers ip address. Navigate to the hosts file of your host machine. Add your IP address and the name of each of the sites created to the hosts file.
  2. Test your new site by typing the name of your site into a web browser. Type /phpmyadmin after your address to test PHP and MySQL.


Collaborative Site Installation
  1. To install Apache you first need to ensure that you have the most current repository. Use the command sudo apt-get update and provide your admin password.
  2. Next use the command sudo apt-get install apache2. You will be prompted to proceed with the install. Type y and press enter to continue.
  3. Install the Apache mod required to run PHP on your server by entering the command sudo apt-get install liabapache2-mod-php. You will be prompted to run the install. Type y and press enter to continue.
  4. Next enter sudo a2query -m php7.0.
  5. Enter the command sudo apt-get install mysql-server. You will be prompted to continue, press y and enter.
  6. Enter a password for the root user of MySQL.
  7. Enter the command sudo apt-get install phpmyadmin. You will be prompted to continue, press y and enter.
  8. Choose to reconfigure apache2, choose yes to configure PHP My Admin and choose a password.
  9. Navigate to /etc/apache2/sites-available.
  10. Copy the Apache2 default config. Folder and rename it after your site. Do this by entering sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/yoursite.conf. Replace yoursite with the name of your website.
  11. Open the file created in step 1. Change the first line to read <VirtualHost *:8088>. Change the server name to www.yoursite.tbd and remove the #. Add ServerAlias www.yoursite.tbd. Change the file path to match the location that you will create the index.html file in.
  1. Create the folder in the location that matches the modifications made to the configuration file that you made in step 2. In that folder create a text file index.html
  1. Navigate to /etc/apache2/ and open the file ports.conf in a text editor. Add the line Listen 8088 above Listen 80. This will configure your server to listen on port 8088.
  1. Enter the command ifconfig and take note of your servers ip address. Navigate to the hosts file of your host machine. Add your IP address and the name of each of the sites created to the hosts file.
  2. Enter the command a2ensite yoursite.tbd to enable your site and restart Apache 2.
  3. Test your new site by typing the name of your site into a web browser. Type /phpmyadmin after your address to test PHP and MySQL.





No comments:

Post a Comment