Skip to content

Instantly share code, notes, and snippets.

@msanjaypandit
Last active April 27, 2018 06:16
Show Gist options
  • Save msanjaypandit/c80c109ef9a2d8c849a945ab4a037f2a to your computer and use it in GitHub Desktop.
Save msanjaypandit/c80c109ef9a2d8c849a945ab4a037f2a to your computer and use it in GitHub Desktop.
[LAMP on AMI] #AMI #AWS #EC-2 #Lamp #centos
  1. Clink on launch a virtual machine
  2. Select "Amazon Linux 2 LTS Candidate AMI 2017.12.0" A latest Amazon linux candidate 64 bit.
  3. Select "t2.micro" as Free tire instance.
  4. select auto option "Configure Instance Details"
  5. insert 30GB as storage.
  6. Create security group and assign port.
  7. click on launch using a new key pair (Remember you need to put .pem file at secure place.)
  8. Now your instance is ready.
  9. ssh -i /web/KP-EC2.pem ec2-user@xxx.xxx.xxx.xxx
  10. sudo yum update -y
    11A. sudo amazon-linux-extras install lamp-mariadb10.2-php7.2
    11B. sudo yum install -y httpd php mariadb-server php-mysqlnd
  11. sudo service httpd start 12A. sudo systemctl start httpd
  12. sudo chkconfig httpd on
    13A. sudo systemctl enable httpd
  13. chkconfig --list httpd
    14A. sudo systemctl is-enabled httpd
  14. sudo systemctl start mariadb.service
    sudo systemctl enable mariadb.service
  15. mysql_secure_installation
  16. sudo yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
  17. Navigate to the Apache document root at /var/www/html (cd /var/www/html).
  18. wget https://files.phpmyadmin.net/phpMyAdmin/4.8.0.1/phpMyAdmin-4.8.0.1-all-languages.zip
  19. tar -xvzf phpMyAdmin-latest-all-languages.tar.gz
  20. mv phpMyAdmin-4.7.5-all-languages phpMyAdmin
  21. sudo systemctl start mariadb
  22. http://xxx.xxx.xxx.xxx/phpMyAdmin
  23. sudo usermod -a -G apache ec2-user
  24. groups to know correct group.
  25. sudo chown -R ec2-user:apache /var/www
  26. sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
  27. find /var/www -type f -exec sudo chmod 0664 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment