CentOS 7.x create lightsail wordpress instance
From Notes_Wiki
Home > CentOS > CentOS 7.x > CentOS 7.x Setup lightsail instances > CentOS 7.x create lightsail wordpress instance
Home > CentOS > CentOS 7.x > Web Based Tools > Wordpress > CentOS 7.x create lightsail wordpress instance
To create a AWS ligtsail instance with wordpress use following steps:
- Create appropriate lightsail instance
- For production instances create static IP and attach with instance
- Create DNS entry for FQDN mapping to static IP
- Allow HTTPS access to server in lightsail instance networking firewall section
- Download corresponding regions private key
- chmod 400 <private-key>
- ssh -i <private-key> centos@<instance-public-ip>
- sudo su -
- Disable SELinux
- yum -y install vim
- vim ~/.ssh/authorized_keys
- Add own key, Allow <private-key> direct root aaccess. (First line 155x)
- Set hostname
- hostname <desired-fqdn>
- vim /etc/hostname
- Exit
- ssh directly as root with self public key
- Search for bitnami installer URL
- yum -y install epel-release
- yum -y install wget
- wget '<Download-URL>' -O '<Installer-filename>'
- yum -y install perl-Data-Dumper
- Create appropriate swap space using CentOS 7.x adding swap space using file
- chmod +x <Installer-filename>
- ./<Installer-filename>
- Give standard answers with simple password and admin username. Email can be configured later.
- Setup fail2ban using CentOS 7.x fail2ban including firewalld using CentOS 7.x Basic firewalld configuration
- Set correct time zone CentOS 7.x Change system timezone
- Configure system to store history date time using Storing date / time along with commands in history
- exit and ssh again for history settings to take effect
- If site at /wordpresss URL is acceptable then use following to redirect automatically from / to /wordpress
- cd /opt/wordpress-<ver>/apache2/htdocs
- mv index.html index-old.html
- wget sbarjatiya.com for downloading index.html containing HTTP meta refresh for redirection
- vim index.html
- Add redirect for /wordpress, Remove google identifier, Set appropriate name
- If instead site is required at / and not at /wordpress refer CentOS 7.x Redirect bitnami wordpress from /wordpress to /
- Generate lets-encrypt certificate if public DNS FQDN is set using:
- cd /opt/wordpress-<ver>
- ./bncert-tool --perform_dns_validation 0
- 'crontab -e' and update
- 0 0 1 * * /opt/wordpress-<version>/letsencrypt/lego
-
- line to to have first two digit 0 and 0 randomized to minutes between 5 to 55 and hour between 1 to 4
- Open site using https://<fqdn> and verify that it is opening properly
- Edit opt/wordpress-<version>/apps/wordpress/htdocs/wp-config.php and update WP_SITEURL and WP_HOME to use https URL
- /opt/wordpress-<ver>/ctlscript.sh restart apache
- Test whether automatic redirection to https is working in private browser
- yum -y install bzip2
- Open /opt/wordpress-<ver>/apps/wordpress/htdocs/wp-config.php and see DB_NAME, DB_USER, DB_PASSWORD and DB_HOST values
- /opt/wordpress-<ver>/mysql/bin/mysql -u bn_wordpress -p bitnami_wordpress
-
- with password read in above step
- Create /opt/take-database-backup.sh with following contents:
- /opt/wordpress-<ver>/mysql/bin/mysqldump -u bn_wordpress -p<password> bitnami_wordpress | bzip2 > /opt/bitnami_wordpress.sql.bz2
- chmod +x above file and test it by running.
- Configure backup for /opt folder which executes /opt/take-database-backup.sh before backup.
- Install logwatch and set /etc/aliases for root user
Home > CentOS > CentOS 7.x > CentOS 7.x Setup lightsail instances > CentOS 7.x create lightsail wordpress instance
Home > CentOS > CentOS 7.x > Web Based Tools > Wordpress > CentOS 7.x create lightsail wordpress instance