Skip to content

Instantly share code, notes, and snippets.

View rraspo's full-sized avatar
🏠
Working from home

Juan A. Porras rraspo

🏠
Working from home
  • Guadalajara, Jalisco
View GitHub Profile
@rraspo
rraspo / remove_public_index_apache.sh
Last active June 20, 2017 16:56
Remove public/index.php from the url generated by Laravel by adding htaccess on public directory
#!/bin/bash
# Make sure httpd.conf has DocumentRoot pointing to /public/ directory
# and that access to the default document root has directive AllowOverride set to All
cat >/var/www/html/.htaccess <<EOL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
EOL
cat /var/www/html/.htaccess
@rraspo
rraspo / header.html
Last active November 23, 2017 17:30
Complete header meta tags for a website
<!-- Page Needs -->
<meta charset="utf-8" />
<title></title>
<meta name="author" content="" />
<meta name="description" content="" />
<!-- Open Graph -->
<meta property="og:title" content="" />
@rraspo
rraspo / letsencrypt.sh
Last active December 22, 2023 20:00
Let's encrypt on an AWS EC2 instance with cronjob to automatically renew it.
#!/bin/bash
# I assume you already have port 443 open and ready to receive requests on your AWS security policies
# As well, I also assume you already have a valid domain pointing to your AWS EC2 instance, since Let's Encrypt does not verify EC2 instances without a domain name
YOUR_DOMAIN=xyz.com
YOUR_SERVER=apache
sudo yum update # Update your AMI dependencies
sudo yum install git, mod24_ssl, gcc
sudo pip install --upgrade pip # Upgrade your pip
cd /opt/
@rraspo
rraspo / lamp.sh
Last active February 6, 2020 02:23
SH to install Laravel LAMP on AWS. Basically a copy-paste from AWS tutorial with composer and mbstring.
sudo yum update -y
sudo yum install -y httpd24 php70 php70-mbstring mysql56-server php70-mysqlnd
sudo service httpd start
sudo chkconfig httpd on
# Check security group allowing http incoming connections - Apache test page should be visible
# Setup www group and future permissions
sudo groupadd www
sudo usermod -a -G www ec2-user
sudo usermod -a -G www apache