This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Apache | |
yum update -y | |
yum install httpd -y | |
systemctl start httpd.service | |
# Enable Apache to start at server boot | |
systemctl enable httpd.service | |
# for EC2 & RDS Database | |
setsebool httpd_can_network_connect_db 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show the default password for root user | |
grep "A temporary password" /var/log/mysqld.log | |
# MySQL Secure Installation | |
mysql_secure_installation | |
# Remove anonymous users? (Press y|Y for Yes, any other key for No) : y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup Yum repository | |
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm | |
# Install MySQL 8 Community Server | |
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo | |
# Install MySQL | |
yum --enablerepo=mysql80-community install mysql-community-server -y | |
# Start MySQL Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Update CentOS | |
Yum -y update | |
# Install Wget | |
yum -y install wget | |
# Enable the PHP 7.3 Remi repository | |
wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm | |
wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "<?php phpinfo(); ?>" > /var/www/html/info.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install git | |
yum -y install git | |
# clone WordPress from repo | |
git clone https://github.com/WordPress/WordPress.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a dump to Dump_date.sql | |
mysqldump --databases -h 'host_DB' 'DataBase name' -u 'User' -p 'Passwd' > /var/www/BackUP/Dump_$(date +"%m-%d-%y").sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -r /var/www/BackUP/wordpress-$(date +"%m-%d-%y").zip /var/www/html/WordPress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** 1. SFTP Installation ** | |
---- $ rpm -qa|grep ssh | |
** 2. SFTP Configuration ** | |
Create sftp folder | |
---- $ mkdir -p /var/sftp | |
---- $ chmod 755 /var/sftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------------------------------- | |
OS/Distro | Official AMI | Legacy / Community / Other AMI ssh Username | | |
---------------------------------------------------------------------------------------- | |
Amazon Linux | ec2-user | | | |
Ubuntu | ubuntu | root | | |
Debian | admin | root | | |
RHEL 6.4 and later | ec2-user | | | |
RHEL 6.3 and earlier | root | | | |
Fedora | fedora | ec2-user, root | | |
Centos | centos | root | |
OlderNewer