User Tools

Site Tools


web:agtek_web_ec2_config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web:agtek_web_ec2_config [2018/08/07 19:26]
mjallison
web:agtek_web_ec2_config [2018/08/08 17:06] (current)
mjallison
Line 1: Line 1:
 ====== Short recipe to configure EC2 for www.agtek.com ====== ====== Short recipe to configure EC2 for www.agtek.com ======
  
-  * Allocate EC2 instance - Amazon Linux 2 instance (t2.small) as of 2018-08 +  * Allocate EC2 instance - Use the ''​Agtek Web Server'' ​private AMI 
-  * ''​amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2''​ +    This is pre-loaded with httpd, php, mysql 
-  ''​sudo yum install ​-httpd mariadb-server''​+    * Note that the mysql database is pre-loaded with old content. A dump / restore is required.
   * Create dump of database from old machine   * Create dump of database from old machine
     * Log into old machine     * Log into old machine
Line 12: Line 12:
       * ''​mysql -u root -p < web.dump''​       * ''​mysql -u root -p < web.dump''​
     * Can set password on db root to some value: ​     * Can set password on db root to some value: ​
-      *  Use mysql command to connect and ''​use mysql''​ then ''​set password for '​root'​@'​%' = PASSWORD('​XYZ'​);''​+      *  Use mysql command to connect and ''​use mysql''​ then  
 +      * ''​set password for '​root'​@'​localhost' = PASSWORD('​XYZ'​);''​
     * Set up to mount web site store     * Set up to mount web site store
       * ''​mkdir /​mnt/​web/''​       * ''​mkdir /​mnt/​web/''​
       * Add to /etc/fstab: "/​dev/​sdf ​   /​mnt/​web ​   ext4    defaults ​       0   ​0"​       * Add to /etc/fstab: "/​dev/​sdf ​   /​mnt/​web ​   ext4    defaults ​       0   ​0"​
       * Attach the web EBS store to the instance       * Attach the web EBS store to the instance
 +      * link /​var/​www/​html to point to /​mnt/​web/​html
 +    * Add content to /​var/​www/​.htaccess
 +
 +      ''​RemoveHandler .html .htm''​
 +      ''​AddType application/​x-httpd-php .php .html .htm''​
 +      ''​AddHandler server-parsed .html''​
 +      ''​AddHandler server-parsed .shtml''​
 +      ''​AddHandler server-parsed .htm''​
 +      ''​php_flag ​ display_errors ​       on''​
 +      ''​php_value error_reporting ​      ​2039''​
 +
web/agtek_web_ec2_config.1533669994.txt.gz · Last modified: 2018/08/07 19:26 by mjallison