Skip to content

Instantly share code, notes, and snippets.

The Purpose of githubinit.sh

is to automate the ....

asumptions

  • initializing current directory

dependencies required

@sipofwater
sipofwater / README.md
Last active November 25, 2021 17:36
Installs and configures a LAMP-based web server.

The Purpose of installwebserver.sh

was to script the installation and configuration of a LAMP webserver (inc: phpMyAdmin, git, Laravel, and curl) as part of my Disaster Recovery Plan. This script has been tested as working on Ubuntu 14.04, 16.04, 20.04.

sh installwebserver.sh <username>

  • takes 1 input parameter <username> for the user
  • installs and configures git
  • installs ^lamp-server
  • installs myphpadmin
  • creates file structure, including for: backups, logfiles, scripts, webroot
  • updates default .conf files to point to new web folders
@sipofwater
sipofwater / README.md
Last active November 25, 2021 17:37
createnewsite.sh - creates a home for a new vhost on a LAMP server

The Purpose of createnewsite.sh

is to automate the creation of a new a VHOST (virtual host) for an Apache server based on the assumptions below. This script has been tested as working on Ubuntu 14.04, 16.04, 20.04.

  • takes 1 input parameter: the <projectname>
  • generates and set permissions on /etc/apache2/sites-available/<projectname>.conf
  • creates /web/webroot/<projectname> folder and sets folder permissions
  • adds /etc/apache2/sites-available/<projectname>.conf to a2ensite
  • runs service apache2 restart enabling the website and making it active
  • generates a reference to <projectname> in /etc/hosts for local DNS resolution of http://<projectname>/
@sipofwater
sipofwater / README.md
Last active August 8, 2019 04:49
rsync LAMP Server Config files and local web folder backup

The Purpose of filesystembackup.sh

is to create a backup of all LAMP server configuration files, shell scripts, web files, and MySQL databases as part of my Disaster Recovery Plan.

backup location(s):

  • /etc/apache2/apache2.conf to /web/backups/etc-apache2/apache2.conf

  • /etc/apache2/sites-available/ to /web/backups/etc-apache2/sites-available/

  • /etc/apache2/sites-enabled/ to /web/backups/etc-apache2/sites-enabled/

  • /etc/php/7.0/apache2/php.ini to /web/backups/etc-php-7.0-apache2/php.ini

  • /web/webroot/ to /web/backups/webroot