diff --git a/DOCUMENTATION/_settings/config.toml b/DOCUMENTATION/_settings/config.toml index 90b5b53..cffc606 100644 --- a/DOCUMENTATION/_settings/config.toml +++ b/DOCUMENTATION/_settings/config.toml @@ -62,8 +62,8 @@ googleAnalytics = "UA-37514928-9" weight = 3 [[menu.main]] - name = "Related Projects" - url = "related-projects/" + name = "Giudes" + url = "guides/" weight = 4 [[menu.main]] @@ -71,15 +71,20 @@ googleAnalytics = "UA-37514928-9" url = "help/" weight = 5 +[[menu.main]] + name = "Related Projects" + url = "related-projects/" + weight = 6 + [[menu.main]] name = "Contributing" url = "contributing/" - weight = 6 + weight = 7 [[menu.main]] name = "License" url = "license/" - weight = 7 + weight = 8 # ------- MENU END ----------------------------------------- diff --git a/DOCUMENTATION/_settings/content/contributing/index.md b/DOCUMENTATION/_settings/content/contributing/index.md index f195fe7..906dcf5 100644 --- a/DOCUMENTATION/_settings/content/contributing/index.md +++ b/DOCUMENTATION/_settings/content/contributing/index.md @@ -1,7 +1,7 @@ --- title: Contributing type: index -weight: 6 +weight: 7 --- diff --git a/_guides/phpstorm.md b/DOCUMENTATION/_settings/content/guides/index.md similarity index 60% rename from _guides/phpstorm.md rename to DOCUMENTATION/_settings/content/guides/index.md index 8dad1a2..6be3e33 100644 --- a/_guides/phpstorm.md +++ b/DOCUMENTATION/_settings/content/guides/index.md @@ -1,49 +1,293 @@ -# PHPStorm Debugging Guide +--- +title: Guides +type: index +weight: 4 +--- + + + +* [Production Setup on Digital Ocean](#Digital-Ocean) +* [PHPStorm XDebug Setup](#PHPStorm-Debugging) + + + + +# Production Setup on Digital Ocean + +## Install Docker + +- Visit [DigitalOcean](https://cloud.digitalocean.com/login) and login. +- Click the `Create Droplet` button. +- Open the `One-click apps` tab. +- Select Docker with your preferred version. +- Continue creating the droplet as you normally would. +- If needed, check your e-mail for the droplet root password. + +## SSH to your Server + +Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server. + +``` +ssh root@ipaddress +``` + +You may be prompted for a password. Type the one you found within your e-mailbox. It'll then ask you to change the password. + +You can now check if Docker is available: + +``` +$root@server:~# docker +``` + +## Set Up Your Laravel Project + +``` +$root@server:~# apt-get install git +$root@server:~# git clone https://github.com/laravel/laravel +$root@server:~# cd laravel +$root@server:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git +$root@server:~/laravel/ cd laradock +``` + +## Install docker-compose command + +``` +$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose +$root@server:~/chmod +x /usr/local/bin/docker-compose +``` + +## Create Your LaraDock Containers + +``` +$root@server:~/laravel/laradock# docker-compose up -d nginx mysql +``` + +Note that more containers are available, find them in the [docs](http://laradock.io/introduction/#supported-software-containers) or the `docker-compose.yml` file. + +## Go to Your Workspace + +``` +docker-compose exec workspace bash +``` + +## Install and configure Laravel + +Let's install Laravel's dependencies, add the `.env` file, generate the key and give proper permissions to the cache folder. + +``` +$ root@workspace:/var/www# composer install +$ root@workspace:/var/www# cp .env.example .env +$ root@workspace:/var/www# php artisan key:generate +$ root@workspace:/var/www# exit +$root@server:~/laravel/laradock# cd .. +$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache +``` + +You can then view your Laravel site by visiting the IP address of your server in your browser. For example: + +``` +http://192.168.1.1 +``` + +It should show you the Laravel default welcome page. + +However, we want it to show up using your custom domain name, as well. + +## Using Your Own Domain Name + +Login to your DNS provider, such as Godaddy, Namecheap. + +Point the Custom Domain Name Server to: + +``` +ns1.digitalocean.com +ns2.digitalocean.com +ns3.digitalocean.com +``` + +Within DigitalOcean, you'll need to change some settings, too. + +Visit: https://cloud.digitalocean.com/networking/domains + +Add your domain name and choose the server IP you'd provision earlier. + +## Serving Site With NGINX (HTTP ONLY) + +Go back to command line. + +``` +$root@server:~/laravel/laradock# cd nginx +$root@server:~/laravel/laradock/nginx# vim laravel.conf +``` + +Remove `default_server` + +``` + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; +``` + +And add `server_name` (your custom domain) + +``` + listen 80; + listen [::]:80 ipv6only=on; + server_name yourdomain.com; +``` + +## Rebuild Your Nginx + +``` +$root@server:~/laravel/laradock/nginx# docker-compose down +$root@server:~/laravel/laradock/nginx# docker-compose build nginx +``` + +## Re Run Your Containers MYSQL and NGINX + +``` +$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql +``` + +**View Your Site with HTTP ONLY (http://yourdomain.com)** + +## Run Site on SSL with Let's Encrypt Certificate + +**Note: You need to Use Caddy here Instead of Nginx** + +To go Caddy Folders and Edit CaddyFile + +``` +$root@server:~/laravel/laradock# cd caddy +$root@server:~/laravel/laradock/caddy# vim Caddyfile +``` + +Remove 0.0.0.0:80 + +``` +0.0.0.0:80 +root /var/www/public +``` + +and replace with your https://yourdomain.com + +``` +https://yourdomain.com +root /var/www/public +``` + +uncomment tls + +``` +#tls self-signed +``` + +and replace self-signed with your email address + +``` +tls serverbreaker@gmai.com +``` + +This is needed Prior to Creating Let's Encypt + +## Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt + +``` +$root@server:~/laravel/laradock/caddy# docker-compose up caddy +``` + +You'll be prompt here to enter your email... you may enter it or not + +``` +Attaching to laradock_mysql_1, laradock_caddy_1 +caddy_1 | Activating privacy features... +caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt. +caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at: +caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf +caddy_1 | Activating privacy features... done. +caddy_1 | https://yourdomain.com +caddy_1 | http://yourdomain.com +``` + +After it finishes, press `Ctrl` + `C` to exit. + +## Stop All Containers and ReRun Caddy and Other Containers on Background + +``` +$root@server:~/laravel/laradock/caddy# docker-compose down +$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy +``` + +View your Site in the Browser Securely Using HTTPS (https://yourdomain.com) + +**Note that Certificate will be Automatically Renew By Caddy** + +>References: +> +- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) +- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/) +- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/) +- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) +- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https) +- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls) +- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile) + + + + + +
+
+
+
+
+ + +# PHPStorm XDebug Setup - [Intro](#Intro) - [Installation](#Installation) - - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) - - [Clean House](#InstallCleanHouse) - - [LaraDock Dial Tone](#InstallLaraDockDialTone) - - [hosts](#AddToHosts) - - [Firewall](#FireWall) + - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) + - [Clean House](#InstallCleanHouse) + - [LaraDock Dial Tone](#InstallLaraDockDialTone) + - [hosts](#AddToHosts) + - [Firewall](#FireWall) - [Enable xDebug on php-fpm](#enablePhpXdebug) - [PHPStorm Settings](#InstallPHPStorm) - [Configs](#InstallPHPStormConfigs) - [Usage](#Usage) - - [Laravel](#UsageLaravel) - - [Run ExampleTest](#UsagePHPStormRunExampleTest) - - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) - - [Debug Web Site](#UsagePHPStormDebugSite) -- [SSH into workspace](#SSHintoWorkspace) - - [KiTTY](#InstallKiTTY) - + - [Laravel](#UsageLaravel) + - [Run ExampleTest](#UsagePHPStormRunExampleTest) + - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) + - [Debug Web Site](#UsagePHPStormDebugSite) +- [SSH into workspace](#SSHintoWorkspace) + - [KiTTY](#InstallKiTTY) + ## Intro -Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, +Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, you should be able to adjust accordingly. This guide was written based on Docker for Windows Native. ## Installation - This guide assumes the following: - - you have already installed and are familiar with Laravel, LaraDock and PHPStorm. - - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. + - you have already installed and are familiar with Laravel, LaraDock and PHPStorm. + - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. ## hosts - Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` On Windows you can find it by opening Windows `Hyper-V Manager`. - ![Windows Hyper-V Manager](photos/PHPStorm/Settings/WindowsHyperVManager.png) - + - [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. - Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png). ## Firewall -Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. +Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. - It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that. - Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic. @@ -51,7 +295,7 @@ Your PHPStorm will need to be able to receive a connection from PHP xdebug eithe ### Edit laradock/docker-compose.yml Set the following variables: ``` -### Workspace Utilities Container ########################### +### Workspace Utilities Container ############### workspace: build: @@ -60,9 +304,9 @@ Set the following variables: - INSTALL_XDEBUG=true - INSTALL_WORKSPACE_SSH=true ... - - -### PHP-FPM Container ####################################### + + +### PHP-FPM Container ##################### php-fpm: build: @@ -70,7 +314,7 @@ Set the following variables: args: - INSTALL_XDEBUG=true ... - + ``` ### Edit xdebug.ini files @@ -91,13 +335,13 @@ xdebug.cli_color=1 Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? Here are a few things I use to clean things up. -- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). +- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). `docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}` - Delete all images containing `laradock`. `docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` **Note:** This will only delete images that were built with `LaraDock`, **NOT** `laradock/*` which are pulled down by `LaraDock` such as `laradock/workspace`, etc. -**Note:** Some may fail with: +**Note:** Some may fail with: `Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` - I added this to my `.bashrc` to remove orphaned images. @@ -107,7 +351,7 @@ Here are a few things I use to clean things up. if [ -n "$processes" ]; thend docker rm $processes fi - + images=`docker images -q -f dangling=true` if [ -n "$images" ]; then docker rmi $images @@ -140,13 +384,13 @@ alias dcleanlaradock=dcleanlaradockfunction ``` -#### Let's get a dial-tone with Laravel +## Let's get a dial-tone with Laravel ``` # barebones at this point docker-compose up -d nginx mysql -# run +# run docker-compose ps # Should see: @@ -163,7 +407,7 @@ laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222- ``` -#### Enable xDebug on php-fpm +## Enable xDebug on php-fpm In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status` You should see something like the following: ``` @@ -181,39 +425,39 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will -#### PHPStorm Settings +## PHPStorm Settings - Here are some settings that are known to work: - `Settings/BuildDeploymentConnection` - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) - + - `Settings/BuildDeploymentConnectionMappings` - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) - + - `Settings/BuildDeploymentDebugger` - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) - + - `Settings/EditRunConfigurationRemoteWebDebug` - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - + - `Settings/EditRunConfigurationRemoteExampleTestDebug` - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - + - `Settings/LangsPHPDebug` - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) - + - `Settings/LangsPHPInterpreters` - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) - + - `Settings/LangsPHPPHPUnit` - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) - + - `Settings/LangsPHPServers` - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) - + - `RemoteHost` To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. - ![RemoteHost](photos/PHPStorm/RemoteHost.png) - + - `RemoteWebDebug` - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) @@ -258,14 +502,14 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will ### Debug WebSite -- In case xDebug is disabled, from the `laradock` folder run: +- In case xDebug is disabled, from the `laradock` folder run: `./xdebugPhpFpm start`. - - To switch xdebug off, run: + - To switch xdebug off, run: `./xdebugPhpFpm stop` - + - Start Remote Debugging - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) - + - Open to edit: `bootstrap/app.php` - Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` - Reload [Laravel Site](http://laravel/) @@ -274,7 +518,7 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will -#### Let's shell into workspace +## Let's shell into workspace Assuming that you are in laradock folder, type: `ssh -i workspace/insecure_id_rsa -p2222 root@laravel` **Cha Ching!!!!** @@ -285,7 +529,7 @@ Assuming that you are in laradock folder, type: -##### KiTTY +### KiTTY [Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. - Here are some settings that are working for me: diff --git a/DOCUMENTATION/_settings/content/license/index.md b/DOCUMENTATION/_settings/content/license/index.md index d65e5ab..795d4c8 100644 --- a/DOCUMENTATION/_settings/content/license/index.md +++ b/DOCUMENTATION/_settings/content/license/index.md @@ -1,7 +1,7 @@ --- title: License type: index -weight: 7 +weight: 8 --- [MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT) diff --git a/DOCUMENTATION/_settings/content/related-projects/index.md b/DOCUMENTATION/_settings/content/related-projects/index.md index b5c3095..de7d0cd 100644 --- a/DOCUMENTATION/_settings/content/related-projects/index.md +++ b/DOCUMENTATION/_settings/content/related-projects/index.md @@ -1,7 +1,7 @@ --- title: Related Projects type: index -weight: 4 +weight: 6 --- Laradock related projects: diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png deleted file mode 100644 index 97ac062..0000000 Binary files a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png and /dev/null differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png deleted file mode 100644 index d3d374b..0000000 Binary files a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png and /dev/null differ diff --git a/_guides/photos/KiTTY/Connection.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Connection.png similarity index 100% rename from _guides/photos/KiTTY/Connection.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Connection.png diff --git a/_guides/photos/KiTTY/ConnectionData.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionData.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionData.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionData.png diff --git a/_guides/photos/KiTTY/ConnectionSSH.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionSSH.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionSSH.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionSSH.png diff --git a/_guides/photos/KiTTY/ConnectionSSHAuth.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionSSHAuth.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionSSHAuth.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/ConnectionSSHAuth.png diff --git a/_guides/photos/KiTTY/Session.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Session.png similarity index 100% rename from _guides/photos/KiTTY/Session.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Session.png diff --git a/_guides/photos/KiTTY/Terminal.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Terminal.png similarity index 100% rename from _guides/photos/KiTTY/Terminal.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Terminal.png diff --git a/_guides/photos/KiTTY/TerminalKeyboard.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/TerminalKeyboard.png similarity index 100% rename from _guides/photos/KiTTY/TerminalKeyboard.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/TerminalKeyboard.png diff --git a/_guides/photos/KiTTY/TerminalShell.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/TerminalShell.png similarity index 100% rename from _guides/photos/KiTTY/TerminalShell.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/TerminalShell.png diff --git a/_guides/photos/KiTTY/Window.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Window.png similarity index 100% rename from _guides/photos/KiTTY/Window.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/Window.png diff --git a/_guides/photos/KiTTY/WindowAppearance.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/WindowAppearance.png similarity index 100% rename from _guides/photos/KiTTY/WindowAppearance.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/KiTTY/WindowAppearance.png diff --git a/_guides/photos/PHPStorm/DebugRemoteOn.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/DebugRemoteOn.png similarity index 100% rename from _guides/photos/PHPStorm/DebugRemoteOn.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/DebugRemoteOn.png diff --git a/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteDebuggingSuccess.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/RemoteHost.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteHost.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteHost.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteHost.png diff --git a/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteTestDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteTestDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteWebDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/RemoteWebDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentConnection.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentConnection.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentDebugger.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/BuildDeploymentDebugger.png diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPDebug.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPDebug.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPInterpreters.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPInterpreters.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPPHPUnit.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPPHPUnit.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPServers.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPServers.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPServers.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/LangsPHPServers.png diff --git a/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png diff --git a/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/WindowsHyperVManager.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/WindowsHyperVManager.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/WindowsHyperVManager.png diff --git a/_guides/photos/PHPStorm/Settings/hosts.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/hosts.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/hosts.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/PHPStorm/Settings/hosts.png diff --git a/_guides/photos/SimpleHostsEditor/AddHost_laravel.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/SimpleHostsEditor/AddHost_laravel.png similarity index 100% rename from _guides/photos/SimpleHostsEditor/AddHost_laravel.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/static/photos/SimpleHostsEditor/AddHost_laravel.png diff --git a/_guides/digital_ocean.md b/_guides/digital_ocean.md deleted file mode 100644 index 4c99b85..0000000 --- a/_guides/digital_ocean.md +++ /dev/null @@ -1,216 +0,0 @@ -#### Install Docker - -- Visit [DigitalOcean](https://cloud.digitalocean.com/login) and login. -- Click the `Create Droplet` button. -- Open the `One-click apps` tab. -- Select Docker with your preferred version. -- Continue creating the droplet as you normally would. -- If needed, check your e-mail for the droplet root password. - -#### SSH to your Server - -Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server. - -``` -ssh root@ipaddress -``` - -You may be prompted for a password. Type the one you found within your e-mailbox. It'll then ask you to change the password. - -You can now check if Docker is available: - -``` -$root@server:~# docker -``` - -#### Set Up Your Laravel Project - -``` -$root@server:~# apt-get install git -$root@server:~# git clone https://github.com/laravel/laravel -$root@server:~# cd laravel -$root@server:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git -$root@server:~/laravel/ cd laradock -``` - -#### Install docker-compose command - -``` -$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose -$root@server:~/chmod +x /usr/local/bin/docker-compose -``` - -#### Create Your LaraDock Containers - -``` -$root@server:~/laravel/laradock# docker-compose up -d nginx mysql -``` - -Note that more containers are available, find them in the [docs](http://laradock.io/introduction/#supported-software-containers) or the `docker-compose.yml` file. - -#### Go to Your Workspace - -``` -docker-compose exec workspace bash -``` - -#### Install and configure Laravel - -Let's install Laravel's dependencies, add the `.env` file, generate the key and give proper permissions to the cache folder. - -``` -$ root@workspace:/var/www# composer install -$ root@workspace:/var/www# cp .env.example .env -$ root@workspace:/var/www# php artisan key:generate -$ root@workspace:/var/www# exit -$root@server:~/laravel/laradock# cd .. -$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache -``` - -You can then view your Laravel site by visiting the IP address of your server in your browser. For example: - -``` -http://192.168.1.1 -``` - -It should show you the Laravel default welcome page. - -However, we want it to show up using your custom domain name, as well. - -#### Using Your Own Domain Name - -Login to your DNS provider, such as Godaddy, Namecheap. - -Point the Custom Domain Name Server to: - -``` -ns1.digitalocean.com -ns2.digitalocean.com -ns3.digitalocean.com -``` - -Within DigitalOcean, you'll need to change some settings, too. - -Visit: https://cloud.digitalocean.com/networking/domains - -Add your domain name and choose the server IP you'd provision earlier. - -#### Serving Site With NGINX (HTTP ONLY) - -Go back to command line. - -``` -$root@server:~/laravel/laradock# cd nginx -$root@server:~/laravel/laradock/nginx# vim laravel.conf -``` - -Remove `default_server` - -``` - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; -``` - -And add `server_name` (your custom domain) - -``` - listen 80; - listen [::]:80 ipv6only=on; - server_name yourdomain.com; -``` - -#### Rebuild Your Nginx - -``` -$root@server:~/laravel/laradock/nginx# docker-compose down -$root@server:~/laravel/laradock/nginx# docker-compose build nginx -``` - -#### Re Run Your Containers MYSQL and NGINX - -``` -$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql -``` - -**View Your Site with HTTP ONLY (http://yourdomain.com)** - -#### Run Site on SSL with Let's Encrypt Certificate - -**Note: You need to Use Caddy here Instead of Nginx** - -To go Caddy Folders and Edit CaddyFile - -``` -$root@server:~/laravel/laradock# cd caddy -$root@server:~/laravel/laradock/caddy# vim Caddyfile -``` - -Remove 0.0.0.0:80 - -``` -0.0.0.0:80 -root /var/www/public -``` - -and replace with your https://yourdomain.com - -``` -https://yourdomain.com -root /var/www/public -``` - -uncomment tls - -``` -#tls self-signed -``` - -and replace self-signed with your email address - -``` -tls serverbreaker@gmai.com -``` - -This is needed Prior to Creating Let's Encypt - -#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt - -``` -$root@server:~/laravel/laradock/caddy# docker-compose up caddy -``` - -You'll be prompt here to enter your email... you may enter it or not - -``` -Attaching to laradock_mysql_1, laradock_caddy_1 -caddy_1 | Activating privacy features... -caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt. -caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at: -caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf -caddy_1 | Activating privacy features... done. -caddy_1 | https://yourdomain.com -caddy_1 | http://yourdomain.com -``` - -After it finishes, press `Ctrl` + `C` to exit. - -#### Stop All Containers and ReRun Caddy and Other Containers on Background - -``` -$root@server:~/laravel/laradock/caddy# docker-compose down -$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy -``` - -View your Site in the Browser Securely Using HTTPS (https://yourdomain.com) - -**Note that Certificate will be Automatically Renew By Caddy** - ->References: -> -- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) -- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/) -- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/) -- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) -- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https) -- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls) -- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile) diff --git a/docs/contributing/index.html b/docs/contributing/index.html index 9117ff0..a1f7f36 100644 --- a/docs/contributing/index.html +++ b/docs/contributing/index.html @@ -211,6 +211,24 @@ + + + Giudes + + + + + + + + + +
  • + + + + + Related Projects @@ -345,20 +363,20 @@ features, by not reporting duplicate issues.

    Laradock uses Hugo as website generator tool, with the Material Docs theme. You might need to check their docs quickly.

    -
      -
    1. Install Hugo on your machine (easy thing).
    2. -
    3. Open the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).
    4. -
    5. Delete the /docs folder from the root.
    6. -
    7. When you finish editing, go to DOCUMENTATION/_settings/ and run the hugo command to generate the HTML docs (inside new /docs folder).
    8. -
    +

    Go the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).

    + +

    To edit the sidebar or add a new section, you need to edit this file DOCUMENTATION/_settings/config.toml as well.

    + +

    The site will be autogenerated in the docs/ folder by Travis.

    To Host the website locally

    -

    Go to DOCUMENTATION/_settings in your terminal and run hugo serve to host the website locally.

    - -

    Edit the sidebar

    - -

    To add a new section to the sidebar or edit existing one, you need to edit this file DOCUMENTATION/_settings/config.toml.

    +
      +
    1. Install Hugo on your machine (easy thing).
    2. +
    3. Edit the DOCUMENTATION/_settings/content.
    4. +
    5. Delete the /docs folder from the root.
    6. +
    7. When you finish editing, go to DOCUMENTATION/_settings/ and run the hugo command to generate the HTML docs (inside new /docs folder).
    8. +

    How to support new Software (Add new Container)

    diff --git a/docs/contributing/index.xml b/docs/contributing/index.xml index b4a9f15..9ba042e 100644 --- a/docs/contributing/index.xml +++ b/docs/contributing/index.xml @@ -48,20 +48,20 @@ features, by not reporting duplicate issues.</em></p> <p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> -<ol> -<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li> -<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li> -<li>Delete the <code>/docs</code> folder from the root.</li> -<li>When you finish editing, go to <code>DOCUMENTATION/_settings/</code> and run the <code>hugo</code> command to generate the HTML docs (inside new <code>/docs</code> folder).</li> -</ol> +<p>Go the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</p> + +<p>To edit the sidebar or add a new section, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code> as well.</p> + +<p><em>The site will be autogenerated in the <code>docs/</code> folder by <a href="https://travis-ci.com/">Travis</a>.</em></p> <h3 id="to-host-the-website-locally">To Host the website locally</h3> -<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p> - -<h3 id="edit-the-sidebar">Edit the sidebar</h3> - -<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p> +<ol> +<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li> +<li>Edit the <code>DOCUMENTATION/_settings/content</code>.</li> +<li>Delete the <code>/docs</code> folder from the root.</li> +<li>When you finish editing, go to <code>DOCUMENTATION/_settings/</code> and run the <code>hugo</code> command to generate the HTML docs (inside new <code>/docs</code> folder).</li> +</ol> <h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2> diff --git a/docs/documentation/index.html b/docs/documentation/index.html index c1c162a..d8e698f 100644 --- a/docs/documentation/index.html +++ b/docs/documentation/index.html @@ -214,6 +214,24 @@ + + + Giudes + + + + + +
  • + + + +
  • + + + + + Related Projects diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index c2fb80a..6b24b2c 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -214,6 +214,24 @@ + + + Giudes + + + + + +
  • + + + +
  • + + + + + Related Projects diff --git a/docs/help/index.html b/docs/help/index.html index b32e679..f49ee6e 100644 --- a/docs/help/index.html +++ b/docs/help/index.html @@ -211,6 +211,24 @@ + + + Giudes + + + + + +
  • + + + +
  • + + + + + Related Projects diff --git a/docs/index.html b/docs/index.html index d363e57..536794c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -214,6 +214,24 @@ + + + Giudes + + + + + +
  • + + + +
  • + + + + + Related Projects @@ -310,6 +328,665 @@
    +

    Guides

    + + + +

    Production Setup on Digital Ocean

    + +

    Install Docker

    + +
      +
    • Visit DigitalOcean and login.
    • +
    • Click the Create Droplet button.
    • +
    • Open the One-click apps tab.
    • +
    • Select Docker with your preferred version.
    • +
    • Continue creating the droplet as you normally would.
    • +
    • If needed, check your e-mail for the droplet root password.
    • +
    + +

    SSH to your Server

    + +

    Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server.

    + +
    ssh root@ipaddress
    +
    + +

    You may be prompted for a password. Type the one you found within your e-mailbox. It’ll then ask you to change the password.

    + +

    You can now check if Docker is available:

    + +
    $root@server:~# docker
    +
    + +

    Set Up Your Laravel Project

    + +
    $root@server:~# apt-get install git
    +$root@server:~# git clone https://github.com/laravel/laravel
    +$root@server:~# cd laravel
    +$root@server:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
    +$root@server:~/laravel/ cd laradock
    +
    + +

    Install docker-compose command

    + +
    $root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
    +$root@server:~/chmod +x /usr/local/bin/docker-compose
    +
    + +

    Create Your LaraDock Containers

    + +
    $root@server:~/laravel/laradock# docker-compose up -d nginx mysql
    +
    + +

    Note that more containers are available, find them in the docs or the docker-compose.yml file.

    + +

    Go to Your Workspace

    + +
    docker-compose exec workspace bash
    +
    + +

    Install and configure Laravel

    + +

    Let’s install Laravel’s dependencies, add the .env file, generate the key and give proper permissions to the cache folder.

    + +
    $ root@workspace:/var/www# composer install
    +$ root@workspace:/var/www# cp .env.example .env
    +$ root@workspace:/var/www# php artisan key:generate
    +$ root@workspace:/var/www# exit
    +$root@server:~/laravel/laradock# cd ..
    +$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache
    +
    + +

    You can then view your Laravel site by visiting the IP address of your server in your browser. For example:

    + +
    http://192.168.1.1
    +
    + +

    It should show you the Laravel default welcome page.

    + +

    However, we want it to show up using your custom domain name, as well.

    + +

    Using Your Own Domain Name

    + +

    Login to your DNS provider, such as Godaddy, Namecheap.

    + +

    Point the Custom Domain Name Server to:

    + +
    ns1.digitalocean.com
    +ns2.digitalocean.com
    +ns3.digitalocean.com
    +
    + +

    Within DigitalOcean, you’ll need to change some settings, too.

    + +

    Visit: https://cloud.digitalocean.com/networking/domains

    + +

    Add your domain name and choose the server IP you’d provision earlier.

    + +

    Serving Site With NGINX (HTTP ONLY)

    + +

    Go back to command line.

    + +
    $root@server:~/laravel/laradock# cd nginx
    +$root@server:~/laravel/laradock/nginx# vim laravel.conf
    +
    + +

    Remove default_server

    + +
        listen 80 default_server;
    +    listen [::]:80 default_server ipv6only=on;
    +
    + +

    And add server_name (your custom domain)

    + +
        listen 80;
    +    listen [::]:80 ipv6only=on;
    +    server_name yourdomain.com;
    +
    + +

    Rebuild Your Nginx

    + +
    $root@server:~/laravel/laradock/nginx# docker-compose down
    +$root@server:~/laravel/laradock/nginx# docker-compose build nginx
    +
    + +

    Re Run Your Containers MYSQL and NGINX

    + +
    $root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
    +
    + +

    View Your Site with HTTP ONLY (http://yourdomain.com)

    + +

    Run Site on SSL with Let’s Encrypt Certificate

    + +

    Note: You need to Use Caddy here Instead of Nginx

    + +

    To go Caddy Folders and Edit CaddyFile

    + +
    $root@server:~/laravel/laradock# cd caddy
    +$root@server:~/laravel/laradock/caddy# vim Caddyfile
    +
    + +

    Remove 0.0.0.0:80

    + +
    0.0.0.0:80
    +root /var/www/public
    +
    + +

    and replace with your https://yourdomain.com

    + +
    https://yourdomain.com
    +root /var/www/public
    +
    + +

    uncomment tls

    + +
    #tls self-signed
    +
    + +

    and replace self-signed with your email address

    + +
    tls serverbreaker@gmai.com
    +
    + +

    This is needed Prior to Creating Let’s Encypt

    + +

    Run Your Caddy Container without the -d flag and Generate SSL with Let’s Encrypt

    + +
    $root@server:~/laravel/laradock/caddy# docker-compose up  caddy
    +
    + +

    You’ll be prompt here to enter your email… you may enter it or not

    + +
    Attaching to laradock_mysql_1, laradock_caddy_1
    +caddy_1               | Activating privacy features...
    +caddy_1               | Your sites will be served over HTTPS automatically using Let's Encrypt.
    +caddy_1               | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
    +caddy_1               |   https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
    +caddy_1               | Activating privacy features... done.
    +caddy_1               | https://yourdomain.com
    +caddy_1               | http://yourdomain.com
    +
    + +

    After it finishes, press Ctrl + C to exit.

    + +

    Stop All Containers and ReRun Caddy and Other Containers on Background

    + +
    $root@server:~/laravel/laradock/caddy# docker-compose down
    +$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
    +
    + +

    View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)

    + +

    Note that Certificate will be Automatically Renew By Caddy

    + +
    +

    References:

    + + +
    + +


    +
    +
    +
    +

    + +

    PHPStorm Debugging Guide

    + + + +

    + +

    Intro

    + +

    Wiring up Laravel, LaraDock [Laravel+Docker] and PHPStorm to play nice together complete with remote xdebug’ing as icing on top! Although this guide is based on PHPStorm Windows, +you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.

    + +

    + +

    Installation

    + +
      +
    • This guide assumes the following: + +
        +
      • you have already installed and are familiar with Laravel, LaraDock and PHPStorm.
      • +
      • you have installed Laravel as a parent of laradock. This guide assumes /c/_dk/laravel.
      • +
    • +
    + +

    + +

    hosts

    + +
      +
    • Add laravel to your hosts file located on Windows 10 at C:\Windows\System32\drivers\etc\hosts. It should be set to the IP of your running container. Mine is: 10.0.75.2 +On Windows you can find it by opening Windows Hyper-V Manager.

      + +
        +
      • Windows Hyper-V Manager
      • +
    • + +
    • Hosts File Editor makes it easy to change your hosts file.

      + +
        +
      • Set laravel to your docker host IP. See Example.
      • +
    • +
    + +

    + +

    Firewall

    + +

    Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.

    + +
      +
    • It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
    • +
    • Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
    • +
    + +

    Edit laradock/docker-compose.yml

    + +

    Set the following variables:

    + +
    ### Workspace Utilities Container ###########################
    +
    +    workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_XDEBUG=true
    +                - INSTALL_WORKSPACE_SSH=true
    +                ...
    +
    +
    +### PHP-FPM Container #######################################
    +
    +    php-fpm:
    +        build:
    +            context: ./php-fpm
    +            args:
    +                - INSTALL_XDEBUG=true
    +                ...
    +
    +
    + +

    Edit xdebug.ini files

    + +
      +
    • laradock/workspace/xdebug.ini
    • +
    • laradock/php-fpm/xdebug.ini
    • +
    + +

    Set the following variables:

    + +
    xdebug.remote_autostart=1
    +xdebug.remote_enable=1
    +xdebug.remote_connect_back=1
    +xdebug.cli_color=1
    +
    + +

    + +

    Need to clean house first?

    + +

    Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? +Here are a few things I use to clean things up.

    + +
      +
    • Delete all containers using grep laradock_ on the names, see: Remove all containers based on docker image name. +docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}

    • + +
    • Delete all images containing laradock. +docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} +Note: This will only delete images that were built with LaraDock, NOT laradock/* which are pulled down by LaraDock such as laradock/workspace, etc. +Note: Some may fail with: +Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images

    • + +
    • I added this to my .bashrc to remove orphaned images.

      + +
      dclean() {
      +    processes=`docker ps -q -f status=exited`
      +    if [ -n "$processes" ]; thend
      +      docker rm $processes
      +    fi
      +
      +    images=`docker images -q -f dangling=true`
      +    if [ -n "$images" ]; then
      +      docker rmi $images
      +    fi
      +}
      +
    • + +
    • If you frequently switch configurations for LaraDock, you may find that adding the following and added to your .bashrc or equivalent useful: +```

      + +

      remove laravel* containers

      + +

      remove laravel_* images

      + +

      dcleanlaradockfunction() +{ + echo ‘Removing ALL containers associated with laradock’ + docker ps -a | awk ‘{ print $1,$2 }’ | grep laradock | awk ‘{print $1}’ | xargs -I {} docker rm {}

    • +
    + +

    # remove ALL images associated with laradock_ + # does NOT delete laradock/* which are hub images + echo ‘Removing ALL images associated with laradock‘ + docker images | awk ‘{print $1,$2,$3}’ | grep laradock | awk ‘{print $3}’ | xargs -I {} docker rmi {}

    + +

    echo ‘Listing all laradock docker hub images…’ + docker images | grep laradock

    + +

    echo ‘dcleanlaradock completed’ +}

    + +

    associate the above function with an alias

    + +

    so can recall/lookup by typing ‘alias’

    + +

    alias dcleanlaradock=dcleanlaradockfunction

    + +
    
    +<a name="InstallLaraDockDialTone"></a>
    +#### Let's get a dial-tone with Laravel
    +
    +
    + +

    barebones at this point

    + +

    docker-compose up -d nginx mysql

    + +

    run

    + +

    docker-compose ps

    + +

    Should see:

    + +
          Name                        Command             State                     Ports
    +
    + +
    + +

    laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp +laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp +laradock_php-fpm_1 php-fpm Up 9000/tcp +laradock_volumes_data_1 true Exit 0 +laradock_volumes_source_1 true Exit 0 +laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp

    + +
    
    +<a name="enablePhpXdebug"></a>
    +#### Enable xDebug on php-fpm
    +In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status`
    +You should see something like the following:
    +
    + +

    xDebug status +laradock_php-fpm_1 +PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) +Copyright © 1997-2016 The PHP Group +Zend Engine v3.0.0, Copyright © 1998-2016 Zend Technologies + with Xdebug v2.4.1, Copyright © 2002-2016, by Derick Rethans +`` +Other commands include./xdebugPhpFpm start | stop`.

    + +

    If you have enabled xdebug=true in docker-compose.yml/php-fpm, xdebug will already be running when +php-fpm is started and listening for debug info on port 9000.

    + +

    + +

    PHPStorm Settings

    + +
      +
    • Here are some settings that are known to work:

      + +
        +
      • Settings/BuildDeploymentConnection

        + +
          +
        • Settings/BuildDeploymentConnection
        • +
      • + +
      • Settings/BuildDeploymentConnectionMappings

        + +
          +
        • Settings/BuildDeploymentConnectionMappings
        • +
      • + +
      • Settings/BuildDeploymentDebugger

        + +
          +
        • Settings/BuildDeploymentDebugger
        • +
      • + +
      • Settings/EditRunConfigurationRemoteWebDebug

        + +
          +
        • Settings/EditRunConfigurationRemoteWebDebug
        • +
      • + +
      • Settings/EditRunConfigurationRemoteExampleTestDebug

        + +
          +
        • Settings/EditRunConfigurationRemoteExampleTestDebug
        • +
      • + +
      • Settings/LangsPHPDebug

        + +
          +
        • Settings/LangsPHPDebug
        • +
      • + +
      • Settings/LangsPHPInterpreters

        + +
          +
        • Settings/LangsPHPInterpreters
        • +
      • + +
      • Settings/LangsPHPPHPUnit

        + +
          +
        • Settings/LangsPHPPHPUnit
        • +
      • + +
      • Settings/LangsPHPServers

        + +
          +
        • Settings/LangsPHPServers
        • +
      • + +
      • RemoteHost +To switch on this view, go to: Menu/Tools/Deployment/Browse Remote Host.

        + +
          +
        • RemoteHost
        • +
      • + +
      • RemoteWebDebug

        + +
          +
        • DebugRemoteOn
        • +
      • + +
      • EditRunConfigurationRemoteWebDebug +Go to: Menu/Run/Edit Configurations.

        + +
          +
        • EditRunConfigurationRemoteWebDebug
        • +
      • + +
      • EditRunConfigurationRemoteExampleTestDebug +Go to: Menu/Run/Edit Configurations.

        + +
          +
        • EditRunConfigurationRemoteExampleTestDebug
        • +
      • + +
      • WindowsFirewallAllowedApps +Go to: Control Panel\All Control Panel Items\Windows Firewall\Allowed apps.

        + +
          +
        • WindowsFirewallAllowedApps.png
        • +
      • + +
      • hosts +Edit: C:\Windows\System32\drivers\etc\hosts.

        + +
      • +
    • +
    + +

    + +

    Usage

    + +

    + +

    Run ExampleTest

    + +
      +
    • right-click on tests/ExampleTest.php + +
        +
      • Select: Run 'ExampleTest.php' or Ctrl+Shift+F10.
      • +
      • Should pass!! You just ran a remote test via SSH!
      • +
    • +
    + +

    + +

    Debug ExampleTest

    + +
      +
    • Open to edit: tests/ExampleTest.php
    • +
    • Add a BreakPoint on line 16: $this->visit('/')
    • +
    • right-click on tests/ExampleTest.php + +
        +
      • Select: Debug 'ExampleTest.php'.
      • +
      • Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
      • +
      • Remote Test Debugging Success
      • +
    • +
    + +

    + +

    Debug WebSite

    + +
      +
    • In case xDebug is disabled, from the laradock folder run: +./xdebugPhpFpm start.

      + +
        +
      • To switch xdebug off, run: +./xdebugPhpFpm stop
      • +
    • + +
    • Start Remote Debugging

      + +
        +
      • DebugRemoteOn
      • +
    • + +
    • Open to edit: bootstrap/app.php

    • + +
    • Add a BreakPoint on line 14: $app = new Illuminate\Foundation\Application(

    • + +
    • Reload Laravel Site

      + +
        +
      • Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
      • +
      • Remote Debugging Success
      • +
    • +
    + +

    + +

    Let’s shell into workspace

    + +

    Assuming that you are in laradock folder, type: +ssh -i workspace/insecure_id_rsa -p2222 root@laravel +Cha Ching!!!! +- workspace/insecure_id_rsa.ppk may become corrupted. In which case: + - fire up puttygen + - import workspace/insecure_id_rsa + - save private key to workspace/insecure_id_rsa.ppk

    + +

    + +
    KiTTY
    + +

    Kitty KiTTY is a fork from version 0.67 of PuTTY.

    + +
      +
    • Here are some settings that are working for me: + +
        +
      • Session
      • +
      • Terminal
      • +
      • Window
      • +
      • WindowAppearance
      • +
      • Connection
      • +
      • ConnectionData
      • +
      • ConnectionSSH
      • +
      • ConnectionSSHAuth
      • +
      • TerminalShell
      • +
    • +
    + +

    Introduction

    @@ -2011,20 +2688,20 @@ features, by not reporting duplicate issues.

    Laradock uses Hugo as website generator tool, with the Material Docs theme. You might need to check their docs quickly.

    -
      -
    1. Install Hugo on your machine (easy thing).
    2. -
    3. Open the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).
    4. -
    5. Delete the /docs folder from the root.
    6. -
    7. When you finish editing, go to DOCUMENTATION/_settings/ and run the hugo command to generate the HTML docs (inside new /docs folder).
    8. -
    +

    Go the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).

    + +

    To edit the sidebar or add a new section, you need to edit this file DOCUMENTATION/_settings/config.toml as well.

    + +

    The site will be autogenerated in the docs/ folder by Travis.

    To Host the website locally

    -

    Go to DOCUMENTATION/_settings in your terminal and run hugo serve to host the website locally.

    - -

    Edit the sidebar

    - -

    To add a new section to the sidebar or edit existing one, you need to edit this file DOCUMENTATION/_settings/config.toml.

    +
      +
    1. Install Hugo on your machine (easy thing).
    2. +
    3. Edit the DOCUMENTATION/_settings/content.
    4. +
    5. Delete the /docs folder from the root.
    6. +
    7. When you finish editing, go to DOCUMENTATION/_settings/ and run the hugo command to generate the HTML docs (inside new /docs folder).
    8. +

    How to support new Software (Add new Container)

    @@ -2180,14 +2857,14 @@ git push origin my-fix-branch -f
  • + + + +
  • + + + + + Related Projects @@ -521,6 +539,22 @@ QUEUE_HOST=beanstalkd
  • + + + +
  • + + + + + Related Projects diff --git a/docs/related-projects/index.html b/docs/related-projects/index.html index 7a5a75a..3fe3d4e 100644 --- a/docs/related-projects/index.html +++ b/docs/related-projects/index.html @@ -211,6 +211,24 @@ + + + Giudes + + + + + +
  • + + + +
  • + + + + + Related Projects diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 69ca8d4..3559048 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,6 +1,10 @@ + + http://laradock.io/guides/ + + http://laradock.io/introduction/ @@ -44,6 +48,11 @@ 0 + + http://laradock.io/guides/ + 0 + + http://laradock.io/help/ 0