Skip to content

Instantly share code, notes, and snippets.

@jonathands
Last active May 29, 2020 17:27
Show Gist options
  • Save jonathands/63c796910db85c7b81d6140d5570605d to your computer and use it in GitHub Desktop.
Save jonathands/63c796910db85c7b81d6140d5570605d to your computer and use it in GitHub Desktop.
amazon php ec2
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
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