DjNaufrago / LAMP-Wordpress-installer

Bash scrip LAMP and WordPress unattended installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LAMP / WORDPRESS - INSTALLERS

Bash scrip LAMP and WordPress unattended installers

The first script performs the unattended installation of the Apache web server, the MariaDB database engine, the modules for interpreting PHP, and configures the firewall.

The second script installs the WordPress content management system.

Please read the installation steps carefully.

PRE-REQUISITES:

  • EC2 (AWS) instance with Ubuntu Server 22.04
  • Allow SSH, HTTP and HTTPS traffic from anywhere (0.0.0.0/0).

INSTRUCTIONS INSTALL LAMP:

  1. Inside the user directory, download the following file:
  2. wget https://raw.githubusercontent.com/DjNaufrago/LAMP-Wordpress-installer/main/install-lamp.sh
  3. Run the script as follows (no sudo):
  4. bash ./install-lamp.sh
  5. Done, you now have a LAMP server up and running.

Can access through your domain name or public ip address. The database root password is in log.txt.

INSTRUCTIONS INSTALL WORDPRESS:

  1. First, let's temporarily make our user the owner of the web folder (the script at the end will take care of undoing this).
  2. sudo chown -R $USER:www-data /var/www/
  3. Move to web directory:
  4. cd /var/www/html
  5. Download the script:
  6. wget https://raw.githubusercontent.com/DjNaufrago/LAMP-Wordpress-installer/main/install-wordpress.sh
  7. The log.txt file from the previous installation must be in the /home/ubuntu directory and must not have been modified. The script will extract from there the root key of the database.
  8. Run the script as follows (no sudo):
  9. bash ./install-wordpress.sh
  10. Done, WordPress is installed and running.

Can access through your domain name or public ip address. Users, passwords and other data are in log.txt. To manage your site: domain/wp-admin or IP/wp-admin

DO NOT DELETE THE LOG.TXT FILE BEFORE BACKING UP THE DATA!

KERNEL MESSAGES

During installation, the operating system will prompt you that some kernel service modules need to be restarted. Accept everything and choose OK. The installation will continue without issue without the need to reboot the entire instance.

TASKS TO CONFIGURE THE LAMP SERVER:

startinstall:

  • Create the file log.txt.

updateupgrade

  • Update repositories list.
  • Update packages that require it.

installapache

  • Install Apache2 Web Server.

installphp

  • Install PHP modules.

installmariadb

  • Install MariaDB Database Manager.
  • Automatically generates the password for the root user of the database manager.
  • Remove anonymous users.
  • Remove remote access.
  • Delete test database.
  • Note: With this script, it is not necessary to run the secure installation for the database.

configfirewall

  • Set rules on the firewall to give access to ssh, http, https.

finishcleanrestart

  • Clean installation cache and files that are no longer needed.
  • Restart the web server for it to take the changes.

TASKS TO CONFIGURE WORDPRESS:

configmariadbwp

  • Create the username, password and database for WordPress.

downloadinstallconfigwp

  • Download the latest core version of WordPress.
  • Register users in web group.
  • Configure and install WordPress.
  • Create and set security values for directories. Prevents PHP code execution.
  • Set the proper permissions for web files and directories.

configweb

  • Adds features to the web server to make Wordpress the default page.
  • Backup of original files that will be modified.

NOTE: The next addition to the script will be to be able to choose the modules to install, including the installation of the SSL certificate.

Sources:

About

Bash scrip LAMP and WordPress unattended installer

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%