Download - Advanced Web Hosting
![Page 1: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/1.jpg)
![Page 2: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/2.jpg)
AdvancedWeb hosting
Vincent Cassé @vcasse
Webhosting lead techOVH
![Page 3: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/3.jpg)
Our offers
Perso
- 5 websites- 100 Gb disk
- 1 x 200 Mb db- Anti DDOS
Kimsufi
- 1 website- 1 Gb disk
- 1 x 100 Mb db- Anti DDOS
Pro
- 10 websites- 250 Gb disk
- 3 x 400 Mb db1 x 2Gb db
- Anti DDOS- SSH access
Performance
- ∞ websites- 500 Gb disk
- 3 x 800 Mb db1 x 4 Gb db
- 1 privateSql- SSH access- dedicated
![Page 4: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/4.jpg)
A small application to deploy
https://rondcoin.ovh
![Page 5: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/5.jpg)
Laravel
- Framework PHP to don’t reinvent the wheel- Use a lot of existing PHP library and composer- Just few hours to develop the “rond coin” app- https://github.com/ovh/summit2016-webhosting-example-rondcoin
![Page 6: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/6.jpg)
How to deploy this application?
![Page 7: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/7.jpg)
Order a web hosting
![Page 8: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/8.jpg)
FTP?
![Page 9: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/9.jpg)
SSH
From “pro” offer PHP cli and Git installed https://github.com/ovh/webhostingsshbashrc
![Page 10: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/10.jpg)
Deploy the code by SSH
$ ssh [email protected]:Welcome to [email protected] (fpm/5.6/prod/legacy) ~ $ git clone https://github.com/ovh/summit2016webhostingexamplerondcoin.gitCloning into summit2016webhostingexamplerondcoin...remote: Counting objects: 133, done.remote: Compressing objects: 100% (99/99), done.remote: Total 133 (delta 19), reused 133 (delta 19), packreused 0Receiving objects: 100% (133/133), 153.26 KiB, done.Resolving deltas: 100% (19/19), done.
![Page 11: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/11.jpg)
Deploy the code: get composer
$ php r "copy('https://getcomposer.org/installer', 'composersetup.php');"$ php r "if (hash_file('SHA384', 'composersetup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composersetup.php'); } echo PHP_EOL;"$ php composersetup.php$ php r "unlink('composersetup.php');"
![Page 12: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/12.jpg)
Deploy the code: install libraries
$ php composer.phar install$ cp .env.example .env$ php artisan key:generate
![Page 13: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/13.jpg)
What is multisite?
- Link multiple domains or subdomains- For tech: like add a virtualhost- No isolation
![Page 14: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/14.jpg)
Laravel structure
.envapi/app/artisanassets/bootstrap/composer.jsonconfig/database/public/resources/routes/storage/tests/vendor/
![Page 15: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/15.jpg)
Edit the ‘rondcoin.ovh’ multisite
![Page 16: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/16.jpg)
What about the database?
![Page 17: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/17.jpg)
Get the private SQL
Better max_connexions No neighbors issues Dedicated resources (CPU / RAM) For performance offer: 1 privateSQL included
![Page 18: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/18.jpg)
Activate the privateSQL
![Page 19: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/19.jpg)
Create the user and database
![Page 20: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/20.jpg)
Create the user and database
![Page 21: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/21.jpg)
Update laravel
$ vim .env…DB_CONNECTION=mysqlDB_HOST=your_db_hostDB_PORT=your_db_portDB_DATABASE=your_db_nameDB_USERNAME=your_db_userDB_PASSWORD=your_db_password…
$ php artisan migrate
![Page 22: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/22.jpg)
Rondcoin.ovh is up!
![Page 23: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/23.jpg)
Deploy theAPI
![Page 24: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/24.jpg)
API?
![Page 25: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/25.jpg)
Laravel: add a new endpoint
$ ls -al public/.htaccesscss/favicon.icofonts/index.phpjs/robots.txtupload/
$ ls -al api/.htaccessindex.php
![Page 26: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/26.jpg)
Add a multisite
![Page 27: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/27.jpg)
API is ready!
https://api.rondcoin.ovh/api/offer
![Page 28: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/28.jpg)
Add aCDN
![Page 29: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/29.jpg)
Content Delivery Network
- Store your static content all around the world- Images / JS / CSS load fastest- Included into ‘performance’ offer
![Page 30: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/30.jpg)
Activate your CDN
![Page 31: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/31.jpg)
Create a ‘assets’ multisite
![Page 32: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/32.jpg)
Activate cache on static content
$ vim public/.htaccess...# Cache des images durant 1 mois<FilesMatch "\.(jpg|jpeg|png|gif)$">Header set CacheControl "maxage=2592000, public"</FilesMatch>
# Cache des javascript et CSS durant 1 mois<FilesMatch "\.(js|css)$">Header set CacheControl "maxage=2592000, public"
![Page 33: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/33.jpg)
Update laravel template
$ vim resources/views/layout/app.blade.php… <! Styles ><link href="http://assets.rondcoin.ovh/css/app.css" rel="stylesheet">
… <! Scripts →<script src="http://assets.rondcoin.ovh/js/app.js"></script>
![Page 34: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/34.jpg)
Environmentconfiguration
![Page 35: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/35.jpg)
Change your PHP
https://www.ovh.com/fr/a1948.php7-nouveautes-deja-le-moment-migrer
![Page 36: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/36.jpg)
Update the .ovhconfig
$ vim ~/.ovhconfig; pour plus d'informations sur ce fichier:; http://www.ovh.com/fr/g1175.format_du_point_ovhconfig
app.engine=phpapp.engine.version=7.1
http.firewall=noneenvironment=productioncontainer.image=stable
![Page 37: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/37.jpg)
RAMcache
![Page 38: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/38.jpg)
Architecture
Webserver
privateSQL
Webserver
Filer
![Page 39: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/39.jpg)
Store cache in /tmp
- /tmp is mount in RAM- Reduce latency to get data from filerzs- Can divide by two the load of the webpage
![Page 40: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/40.jpg)
Store laravel cache in /tmp
$ vim config/cache.php…'file' => [ 'driver' => 'file', 'path' => '/tmp',],
$ vim config/session.php…'files' => '/tmp',
$ vim config/view.php…'compiled' => '/tmp',
![Page 41: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/41.jpg)
Another tips
- Use “cron” for asynchronous tasks- You can see all your logs in logs.clusterXXX.hosting.ovh.net- Use “boost” if you have previsible load peaks- Check external connexions from PHP (APIs like twitter...)
![Page 42: Advanced Web Hosting](https://reader034.vdocument.in/reader034/viewer/2022051101/58794bc11a28abb1418b4ecf/html5/thumbnails/42.jpg)
Vincent Cassé
@vcasse