title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
This file contains hidden or 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
| ######################################################################## | |
| # OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019 | |
| # ---------------------------------------------------------------------- | |
| # @Author: Andreas Hecht | |
| # @Author URI: https://andreas-hecht.com | |
| # License: GNU General Public License v2 or later | |
| # License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| ######################################################################## | |
This file contains hidden or 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
| <?php | |
| $args = array( | |
| 'orderby' => 'ID' | |
| ); | |
| $terms = get_terms( 'testimonial_category', $args ); | |
| ?> | |
| <!-- bootstrap tabs --> | |
| <ul class="nav-tabs"> | |
| <?php |
$ xcode-select --install
$ softwareupdate --list
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerAdmin admin@yourdomain.com | |
| ServerName yourdomain.com | |
| ServerAlias www.yourdomain.com | |
| DocumentRoot /home/yourdomain/public_html | |
| <Directory /> | |
| Options None | |
| AllowOverride None | |
| Order Deny,Allow | |
| Deny from all |
This file contains hidden or 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
| ## LEVERAGE BROWSER CACHING ## | |
| <IfModule mod_expires.c> | |
| ExpiresActive On | |
| # Add correct content-type for fonts | |
| AddType application/vnd.ms-fontobject .eot | |
| AddType application/x-font-ttf .ttf | |
| AddType application/x-font-opentype .otf | |
| AddType application/x-font-woff .woff | |
| AddType image/svg+xml .svg |
This file contains hidden or 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
| function get_top_parent_page_id() { | |
| global $post; | |
| $ancestors = $post->ancestors; | |
| // Check if page is a child page (any level) | |
| if ($ancestors) { | |
| // Grab the ID of top-level page from the tree |
This file contains hidden or 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
| ######################################################################## | |
| # OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2018 | |
| ######################################################################## | |
| # ---------------------------------------------------------------------- | |
| # Rewrite from HTTP to HTTPS - if you want to use it, comment it out | |
| # ---------------------------------------------------------------------- |
This file contains hidden or 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
| public function custom_create_user($user_name, $first_name, $last_name, $email_address, $user_role = 'subscriber') | |
| { | |
| $user_id = username_exists( $user_name ); | |
| if( $user_id != null ) | |
| { | |
| throw New Exception('Username already exists!'); | |
| } | |
| if ( email_exists($email_address) == true ) |
NewerOlder