web:agtek_web_ec2_config

This is an old revision of the document!


Short recipe to configure EC2 for www.agtek.com

  • Allocate EC2 instance - Amazon Linux 2 instance (t2.small) as of 2018-08
  • amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
  • sudo yum install -y httpd mariadb-server
  • systemctl enable httpd
  • systemctl enable mariadb
  • systemctl start httpd
  • systemctl start mariadb
  • Create dump of database from old machine
    • Log into old machine
    • Connect to mysql for dump:
      • mysqldump -u root -p –all-databases > web.dump
    • Copy web.dump to new machine
    • Log into new machine and restore
      • mysql -u root -p < web.dump
    • Can set password on db root to some value:
      • Use mysql command to connect and use mysql then
      • set password for 'root'@'localhost' = PASSWORD('XYZ');
    • Set up to mount web site store
      • mkdir /mnt/web/
      • Add to /etc/fstab: “/dev/sdf /mnt/web ext4 defaults 0 0”
      • Attach the web EBS store to the instance
      • link /var/www/html to point to /mnt/web/html
web/agtek_web_ec2_config.1533670361.txt.gz · Last modified: 2018/08/07 19:32 by mjallison