Last active
May 29, 2020 17:27
-
-
Save jonathands/63c796910db85c7b81d6140d5570605d to your computer and use it in GitHub Desktop.
amazon php ec2
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
sudo amazon-linux-extras install epel -y | |
sudo yum install epel-release -y | |
sudo yum update -y | |
sudo amazon-linux-extras install "php7.4" -y | |
sudo yum install -y httpd php7.4 php-pgsql php-pdo_pgsql php-gd php-intl php-mbstring php-json git awscli certbot certbot-apache | |
#open ports | |
aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXXX --protocol tcp --port 80 --cidr 0.0.0.0/0 | |
aws ec2 authorize-security-group-ingress --group-id sg-XXXXXXXXXXXXXXXXX --protocol tcp --port 443 --cidr 0.0.0.0/0 | |
sudo systemctl enable httpd.service | |
sudo systemctl start httpd | |
sudo certbot --apache |
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
Listen 80 | |
NameVirtualHost *:80 | |
Listen 443 | |
NameVirtualHost *:443 | |
ServerName site.com.br | |
DocumentRoot "/var/www/html/site.com.br" | |
<VirtualHost *:80 *:443> | |
DocumentRoot "/var/www/html/site.com.br" | |
ServerName site.com.br | |
Order allow,deny | |
Allow from all | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment