SlideShare a Scribd company logo
LAMP stack opzetten
Peter Martin, twitter: @pe7er
Linux User Group Nijmegen, 8 april 2014
Overzicht Presentatie
● Introductie
● VirtualBox & Vagrant
● LAMP Stack
● Joomla / WordPress website
Webserver – statisch
● Browser – vraagt server om webpagina's (HTML)
● HTML pagina
● Tekst bestand met opmaak code
● Verwijzingen naar plaatjes, CSS (vormgeving),
JavaScript (script dat browser uitvoert)
● Webserver handelt aanvragen voor HTML pagina's af
Webserver – dynamisch
● Webserver bouwt HTML pagina's zelf op on-the-fly
● Door middel van server-side-script, bijv PHP
● Met gegevens uit database, bijv MySQL
● Content Management Systeem
● Grafische webinterface om gegevens in database te
beheren en aan bezoekers te tonen
● CMS Top 3: WordPress, Joomla, Drupal
http://w3techs.com/technologies/overview/content_man
agement/all
VirtualBox & Vagrant
VirtualBox
● Mijn Laptop
● Joomla websites ontwikkelen
● Heeft al LAMP ontwikkel omgeving
● Niet geschikt voor LAMP installatie demo
VirtualBox
● Virtualisatie
● besturingssysteem binnen besturingssysteem
● VirtualBox – “Oracle VM VirtualBox”
● Download https://www.virtualbox.org/
● Installatie op Linux Debian 7:
$ dpkg – i virtualbox-4.3_4.3.10-93012~Debian~wheezy_amd64
● Opstarten & vanuit .iso een omgeving installeren
Vagrant
● Maken en configureren van virtuele
ontwikkelomgevingen
● “wrapper” rond virtualisatie software
● Download http://www.vagrantup.com/
● Installatie:
$ sudo dpkg –i vagrant_1.5.2_x86_64.deb
● Map aanmaken, bijv in home map:
$ mkdir ~Vagrant
Vagrant Cloud
● Kant-en-klaar virtuele ontwikkelomgevingen
● https://vagrantcloud.com/
● Bijv Debian 7 64 bit
● https://vagrantcloud.com/chef/debian-7.4
● Vagrant Box installeren:
$ vagrant box add chef/debian-7.4
→ paar minuten
Vagrant Box installeren
● Per project projectmap aanmaken,
bijv ~/Vagrant/linuxnijmegen
● Vagrant Box initialiseren:
$ vagrant init chef/debian-7.4
● Configuratie file: “Vagrantfile”
automatisch:
config.vm.box = "chef/debian-7.4"
handmatig:
config.vm.network "forwarded_port", guest: 80, host: 8080
Vagrant Box installeren
● Vagrant Box starten:
$ vagrant up
● Inloggen op Vagrant Box:
$ vagrant ssh
LAMP stack
Apache
Apache
Automatische installatie “Task Select”
$ tasksel
Apache
● “Tasksel” → geen controle over installatie
● Handmatige installatie:
$ sudo apt-get install apache2
● Start/stop/restart:
$ sudo service apache2 start
● Installatie mod rewrite:
$ sudo a2enmod rewrite
● Mod Rewrite werkt niet?
$ sudo nano /etc/apache2/sites-enabled/000-default
AllowOverride None
→ AllowOverride All
Apache
● “Could not reliably determine the server's fully
qualified domain name, using 127.0.1.1 for
ServerName”
$ echo "ServerName localhost" | sudo tee
/etc/apache2/conf.d/fqdn
Apache ownership issues
● Op test (niet op live!!) omgeving:
● Apache draaien onder user “vagrant”:
$ sudo nano /etc/apache2/envvars
export APACHE_RUN_USER=vagrant
export APACHE_RUN_GROUP=vagrant
● Restart Apache error?
$ sudo rm -R /var/lock/apache2
● Webroot & files toewijzen aan “vagrant”:
● $ sudo chown -R vagrant:vagrant /var/www/
Database
Database – MySQL
● Installatie MySQL
$ sudo apt-get install mysql-server
● Secure MySQL
$ sudo mysql_secure_installation
● Maak database voor Joomla CMS
$ mysql -u root -p
CREATE DATABASE joomla;
SHOW DATABASES;
q
Server Script
Server Script – PHP
● Installatie PHP + MySQL koppeling
$ sudo apt-get install php5 php5-mysql
● Test:
$ sudo nano /var/www/test.php
<?php phpinfo(); ?>
Database GUI
Database GUI – phpMyAdmin
● Installatie:
$ sudo apt-get install phpmyadmin
● Browser:
http://localhost:8080/phpmyadmin/
Joomla
Joomla
● Installatie:
$ sudo wget
http://joomlacode.org/gf/download/frsrelease/19340/158
535/Joomla_3.3.0.beta-Beta-Full_Package.zip
● Unzip:
$ sudo unzip Joomla_3.3.0.beta-Beta-
Update_Package.zip
● Browser:
http://localhost:8080/joomla/
Vragen?
Peter Martin
e-mail: info at db8.nl
website: www.db8.nl
twitter: @pe7er
Used Photos
● Behind the Web - dreamguy http://www.freeimages.com/photo/107106
● Carton empty box - humusak2 http://www.freeimages.com/photo/1440365
● light bulb off - humusak2 http://www.freeimages.com/photo/1418476
● Hiawatha (Little Golden Book) - DisneyWiki
http://disney.wikia.com/wiki/Hiawatha_(Little_Golden_Book)
● lots of files 2 - Michael & Christa Richert
http://www.freeimages.com/photo/1370555
● Punch Card - Charles Toepfer http://www.freeimages.com/photo/262494
● digital world - ilker http://www.freeimages.com/photo/1206711

More Related Content

Viewers also liked

Linux lessen gebruik (Maarten Blomme)
Linux lessen gebruik (Maarten Blomme)Linux lessen gebruik (Maarten Blomme)
Linux lessen gebruik (Maarten Blomme)
Avansa Mid- en Zuidwest
 
Datastruct1
Datastruct1Datastruct1
Datastruct1
roy-de-zomer
 
Javascript Dhtml
Javascript DhtmlJavascript Dhtml
Javascript Dhtml
paul.verhoef
 
Let's Encrypt Techtalk @Openminds
Let's Encrypt Techtalk @OpenmindsLet's Encrypt Techtalk @Openminds
Let's Encrypt Techtalk @Openminds
sorcix
 
Presentatie Debian (GNU/Linux)
Presentatie Debian (GNU/Linux)Presentatie Debian (GNU/Linux)
Presentatie Debian (GNU/Linux)
Avansa Mid- en Zuidwest
 
Linux command-line-magic-jdnl15
Linux command-line-magic-jdnl15Linux command-line-magic-jdnl15
Linux command-line-magic-jdnl15
Peter Martin
 
Top 10 Interesting Facts About Solar System
Top 10 Interesting Facts About Solar SystemTop 10 Interesting Facts About Solar System
Top 10 Interesting Facts About Solar System
Tenfact
 

Viewers also liked (7)

Linux lessen gebruik (Maarten Blomme)
Linux lessen gebruik (Maarten Blomme)Linux lessen gebruik (Maarten Blomme)
Linux lessen gebruik (Maarten Blomme)
 
Datastruct1
Datastruct1Datastruct1
Datastruct1
 
Javascript Dhtml
Javascript DhtmlJavascript Dhtml
Javascript Dhtml
 
Let's Encrypt Techtalk @Openminds
Let's Encrypt Techtalk @OpenmindsLet's Encrypt Techtalk @Openminds
Let's Encrypt Techtalk @Openminds
 
Presentatie Debian (GNU/Linux)
Presentatie Debian (GNU/Linux)Presentatie Debian (GNU/Linux)
Presentatie Debian (GNU/Linux)
 
Linux command-line-magic-jdnl15
Linux command-line-magic-jdnl15Linux command-line-magic-jdnl15
Linux command-line-magic-jdnl15
 
Top 10 Interesting Facts About Solar System
Top 10 Interesting Facts About Solar SystemTop 10 Interesting Facts About Solar System
Top 10 Interesting Facts About Solar System
 

Similar to Linux Nijmegen - Webserver (LAMP stack) opzetten met VirtualbBox & Vagrant

Serving Up Your Rails App On A Mongrel Cluster
Serving Up Your Rails App On A Mongrel ClusterServing Up Your Rails App On A Mongrel Cluster
Serving Up Your Rails App On A Mongrel Cluster
Robbert
 
Vagrant
VagrantVagrant
Vagrant
Nav Appaiya
 
Hands on presentatie
Hands on presentatieHands on presentatie
Hands on presentatie
Jan Vansteenkiste
 
Open Computer and Software Inventory
Open Computer and Software InventoryOpen Computer and Software Inventory
Open Computer and Software Inventory
247 Invest
 
MediaMosa Installatie & Configuratie
MediaMosa Installatie & ConfiguratieMediaMosa Installatie & Configuratie
MediaMosa Installatie & Configuratie
MediaMosa
 
Techtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPMTechtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPM
Webscale
 
Infra as Code workshop
Infra as Code workshopInfra as Code workshop
Infra as Code workshop
MarinoDekker
 
WordPress website onderhoud met wp cli
WordPress website onderhoud met wp cliWordPress website onderhoud met wp cli
WordPress website onderhoud met wp cli
AartGeys
 
PFZ Workshop - Automatiseren van functionele tests
PFZ Workshop - Automatiseren van functionele testsPFZ Workshop - Automatiseren van functionele tests
PFZ Workshop - Automatiseren van functionele testsRichard Tuin
 
Rf meetup 20210412 robo_con
Rf meetup 20210412 robo_conRf meetup 20210412 robo_con
Rf meetup 20210412 robo_con
christiantester
 
Workshop VirtualBox (Jesus Isern Comas)
Workshop VirtualBox (Jesus Isern Comas)Workshop VirtualBox (Jesus Isern Comas)
Workshop VirtualBox (Jesus Isern Comas)
Avansa Mid- en Zuidwest
 
Speeding up WordPress
Speeding up WordPressSpeeding up WordPress
Speeding up WordPress
Brecht Ryckaert
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknetHans Rossel
 
Object Oriented Programming for web applications
Object Oriented Programming for web applicationsObject Oriented Programming for web applications
Object Oriented Programming for web applications
Edwin Vlieg
 
Presentatie joomladagen 2017
Presentatie joomladagen 2017Presentatie joomladagen 2017
Presentatie joomladagen 2017
Teeuwis Hillebrand
 
Javascript Intro
Javascript IntroJavascript Intro
Javascript IntroHans Rossel
 
WSO2 Mashup Server
WSO2 Mashup ServerWSO2 Mashup Server
WSO2 Mashup Server
Nils Breunese
 
De 10 geboden van WordPress Development
De 10 geboden van WordPress DevelopmentDe 10 geboden van WordPress Development
De 10 geboden van WordPress Development
Floris Lof
 
Cursus Zend Framework - 1
Cursus Zend Framework - 1Cursus Zend Framework - 1
Cursus Zend Framework - 1bartjeukendrup
 
Drupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingDrupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingLuciuswebsystems
 

Similar to Linux Nijmegen - Webserver (LAMP stack) opzetten met VirtualbBox & Vagrant (20)

Serving Up Your Rails App On A Mongrel Cluster
Serving Up Your Rails App On A Mongrel ClusterServing Up Your Rails App On A Mongrel Cluster
Serving Up Your Rails App On A Mongrel Cluster
 
Vagrant
VagrantVagrant
Vagrant
 
Hands on presentatie
Hands on presentatieHands on presentatie
Hands on presentatie
 
Open Computer and Software Inventory
Open Computer and Software InventoryOpen Computer and Software Inventory
Open Computer and Software Inventory
 
MediaMosa Installatie & Configuratie
MediaMosa Installatie & ConfiguratieMediaMosa Installatie & Configuratie
MediaMosa Installatie & Configuratie
 
Techtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPMTechtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPM
 
Infra as Code workshop
Infra as Code workshopInfra as Code workshop
Infra as Code workshop
 
WordPress website onderhoud met wp cli
WordPress website onderhoud met wp cliWordPress website onderhoud met wp cli
WordPress website onderhoud met wp cli
 
PFZ Workshop - Automatiseren van functionele tests
PFZ Workshop - Automatiseren van functionele testsPFZ Workshop - Automatiseren van functionele tests
PFZ Workshop - Automatiseren van functionele tests
 
Rf meetup 20210412 robo_con
Rf meetup 20210412 robo_conRf meetup 20210412 robo_con
Rf meetup 20210412 robo_con
 
Workshop VirtualBox (Jesus Isern Comas)
Workshop VirtualBox (Jesus Isern Comas)Workshop VirtualBox (Jesus Isern Comas)
Workshop VirtualBox (Jesus Isern Comas)
 
Speeding up WordPress
Speeding up WordPressSpeeding up WordPress
Speeding up WordPress
 
Html5 jeugdwerknet
Html5 jeugdwerknetHtml5 jeugdwerknet
Html5 jeugdwerknet
 
Object Oriented Programming for web applications
Object Oriented Programming for web applicationsObject Oriented Programming for web applications
Object Oriented Programming for web applications
 
Presentatie joomladagen 2017
Presentatie joomladagen 2017Presentatie joomladagen 2017
Presentatie joomladagen 2017
 
Javascript Intro
Javascript IntroJavascript Intro
Javascript Intro
 
WSO2 Mashup Server
WSO2 Mashup ServerWSO2 Mashup Server
WSO2 Mashup Server
 
De 10 geboden van WordPress Development
De 10 geboden van WordPress DevelopmentDe 10 geboden van WordPress Development
De 10 geboden van WordPress Development
 
Cursus Zend Framework - 1
Cursus Zend Framework - 1Cursus Zend Framework - 1
Cursus Zend Framework - 1
 
Drupal Uitgebreide Starters Training
Drupal Uitgebreide Starters TrainingDrupal Uitgebreide Starters Training
Drupal Uitgebreide Starters Training
 

More from Peter Martin

Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
Peter Martin
 
JCE editor optimaliseren (Joomla Den Bosc­h 2016)
JCE editor optimaliseren (Joomla Den Bosc­h 2016)JCE editor optimaliseren (Joomla Den Bosc­h 2016)
JCE editor optimaliseren (Joomla Den Bosc­h 2016)
Peter Martin
 
Internet of Things - Linux Usergroup Nijmegen
Internet of Things - Linux Usergroup NijmegenInternet of Things - Linux Usergroup Nijmegen
Internet of Things - Linux Usergroup Nijmegen
Peter Martin
 
Joomla: 10 years of progress (jd15fr)
Joomla: 10 years of progress (jd15fr)Joomla: 10 years of progress (jd15fr)
Joomla: 10 years of progress (jd15fr)
Peter Martin
 
Joomla 10-jaar-vooruitgang-jdnl15
Joomla 10-jaar-vooruitgang-jdnl15Joomla 10-jaar-vooruitgang-jdnl15
Joomla 10-jaar-vooruitgang-jdnl15
Peter Martin
 
GNU Radio & digitaal vliegtuig spotten
GNU Radio & digitaal vliegtuig spottenGNU Radio & digitaal vliegtuig spotten
GNU Radio & digitaal vliegtuig spotten
Peter Martin
 
Help mijn website is gehackt - Joomla User Group Den Bosch 2014
Help mijn website is gehackt - Joomla User Group Den Bosch 2014Help mijn website is gehackt - Joomla User Group Den Bosch 2014
Help mijn website is gehackt - Joomla User Group Den Bosch 2014
Peter Martin
 
Music Trackers - Linux Usergroup Nijmegen 2014
Music Trackers - Linux Usergroup Nijmegen 2014Music Trackers - Linux Usergroup Nijmegen 2014
Music Trackers - Linux Usergroup Nijmegen 2014
Peter Martin
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
Peter Martin
 
How IT works - Joomladay UK 2014
How IT works - Joomladay UK 2014How IT works - Joomladay UK 2014
How IT works - Joomladay UK 2014
Peter Martin
 
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
Peter Martin
 
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
Peter Martin
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Peter Martin
 
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
Peter Martin
 
Troubleshooting Joomla! problems - Joomladay Germany 2014
Troubleshooting Joomla! problems - Joomladay Germany 2014Troubleshooting Joomla! problems - Joomladay Germany 2014
Troubleshooting Joomla! problems - Joomladay Germany 2014
Peter Martin
 
How IT works - Joomladay Germany 2014
How IT works - Joomladay Germany 2014How IT works - Joomladay Germany 2014
How IT works - Joomladay Germany 2014
Peter Martin
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014
Peter Martin
 
Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014
Peter Martin
 
Joomla Bugs, Patches & Fun - Joomladagen 2014
Joomla Bugs, Patches & Fun - Joomladagen 2014Joomla Bugs, Patches & Fun - Joomladagen 2014
Joomla Bugs, Patches & Fun - Joomladagen 2014
Peter Martin
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)
Peter Martin
 

More from Peter Martin (20)

Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
 
JCE editor optimaliseren (Joomla Den Bosc­h 2016)
JCE editor optimaliseren (Joomla Den Bosc­h 2016)JCE editor optimaliseren (Joomla Den Bosc­h 2016)
JCE editor optimaliseren (Joomla Den Bosc­h 2016)
 
Internet of Things - Linux Usergroup Nijmegen
Internet of Things - Linux Usergroup NijmegenInternet of Things - Linux Usergroup Nijmegen
Internet of Things - Linux Usergroup Nijmegen
 
Joomla: 10 years of progress (jd15fr)
Joomla: 10 years of progress (jd15fr)Joomla: 10 years of progress (jd15fr)
Joomla: 10 years of progress (jd15fr)
 
Joomla 10-jaar-vooruitgang-jdnl15
Joomla 10-jaar-vooruitgang-jdnl15Joomla 10-jaar-vooruitgang-jdnl15
Joomla 10-jaar-vooruitgang-jdnl15
 
GNU Radio & digitaal vliegtuig spotten
GNU Radio & digitaal vliegtuig spottenGNU Radio & digitaal vliegtuig spotten
GNU Radio & digitaal vliegtuig spotten
 
Help mijn website is gehackt - Joomla User Group Den Bosch 2014
Help mijn website is gehackt - Joomla User Group Den Bosch 2014Help mijn website is gehackt - Joomla User Group Den Bosch 2014
Help mijn website is gehackt - Joomla User Group Den Bosch 2014
 
Music Trackers - Linux Usergroup Nijmegen 2014
Music Trackers - Linux Usergroup Nijmegen 2014Music Trackers - Linux Usergroup Nijmegen 2014
Music Trackers - Linux Usergroup Nijmegen 2014
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
How IT works - Joomladay UK 2014
How IT works - Joomladay UK 2014How IT works - Joomladay UK 2014
How IT works - Joomladay UK 2014
 
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
Developing a Joomla 3.x Component using RAD/FOF - Joomladay UK 2014
 
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
Joomla multilingual website without 3rd party extensions - Joomladay UK 2014
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
 
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
Developing a Joomla 3.x Component using RAD FOF- Part 1: Back-end - Joomladay...
 
Troubleshooting Joomla! problems - Joomladay Germany 2014
Troubleshooting Joomla! problems - Joomladay Germany 2014Troubleshooting Joomla! problems - Joomladay Germany 2014
Troubleshooting Joomla! problems - Joomladay Germany 2014
 
How IT works - Joomladay Germany 2014
How IT works - Joomladay Germany 2014How IT works - Joomladay Germany 2014
How IT works - Joomladay Germany 2014
 
Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014Problemen oplossen in Joomla - Joomladagen 2014
Problemen oplossen in Joomla - Joomladagen 2014
 
Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014Joomla 3 Component programmeren met RAD - Joomladagen 2014
Joomla 3 Component programmeren met RAD - Joomladagen 2014
 
Joomla Bugs, Patches & Fun - Joomladagen 2014
Joomla Bugs, Patches & Fun - Joomladagen 2014Joomla Bugs, Patches & Fun - Joomladagen 2014
Joomla Bugs, Patches & Fun - Joomladagen 2014
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)
 

Linux Nijmegen - Webserver (LAMP stack) opzetten met VirtualbBox & Vagrant

  • 1. LAMP stack opzetten Peter Martin, twitter: @pe7er Linux User Group Nijmegen, 8 april 2014
  • 2. Overzicht Presentatie ● Introductie ● VirtualBox & Vagrant ● LAMP Stack ● Joomla / WordPress website
  • 3. Webserver – statisch ● Browser – vraagt server om webpagina's (HTML) ● HTML pagina ● Tekst bestand met opmaak code ● Verwijzingen naar plaatjes, CSS (vormgeving), JavaScript (script dat browser uitvoert) ● Webserver handelt aanvragen voor HTML pagina's af
  • 4. Webserver – dynamisch ● Webserver bouwt HTML pagina's zelf op on-the-fly ● Door middel van server-side-script, bijv PHP ● Met gegevens uit database, bijv MySQL ● Content Management Systeem ● Grafische webinterface om gegevens in database te beheren en aan bezoekers te tonen ● CMS Top 3: WordPress, Joomla, Drupal http://w3techs.com/technologies/overview/content_man agement/all
  • 6. VirtualBox ● Mijn Laptop ● Joomla websites ontwikkelen ● Heeft al LAMP ontwikkel omgeving ● Niet geschikt voor LAMP installatie demo
  • 7. VirtualBox ● Virtualisatie ● besturingssysteem binnen besturingssysteem ● VirtualBox – “Oracle VM VirtualBox” ● Download https://www.virtualbox.org/ ● Installatie op Linux Debian 7: $ dpkg – i virtualbox-4.3_4.3.10-93012~Debian~wheezy_amd64 ● Opstarten & vanuit .iso een omgeving installeren
  • 8. Vagrant ● Maken en configureren van virtuele ontwikkelomgevingen ● “wrapper” rond virtualisatie software ● Download http://www.vagrantup.com/ ● Installatie: $ sudo dpkg –i vagrant_1.5.2_x86_64.deb ● Map aanmaken, bijv in home map: $ mkdir ~Vagrant
  • 9. Vagrant Cloud ● Kant-en-klaar virtuele ontwikkelomgevingen ● https://vagrantcloud.com/ ● Bijv Debian 7 64 bit ● https://vagrantcloud.com/chef/debian-7.4 ● Vagrant Box installeren: $ vagrant box add chef/debian-7.4 → paar minuten
  • 10. Vagrant Box installeren ● Per project projectmap aanmaken, bijv ~/Vagrant/linuxnijmegen ● Vagrant Box initialiseren: $ vagrant init chef/debian-7.4 ● Configuratie file: “Vagrantfile” automatisch: config.vm.box = "chef/debian-7.4" handmatig: config.vm.network "forwarded_port", guest: 80, host: 8080
  • 11. Vagrant Box installeren ● Vagrant Box starten: $ vagrant up ● Inloggen op Vagrant Box: $ vagrant ssh
  • 15. Apache ● “Tasksel” → geen controle over installatie ● Handmatige installatie: $ sudo apt-get install apache2 ● Start/stop/restart: $ sudo service apache2 start ● Installatie mod rewrite: $ sudo a2enmod rewrite ● Mod Rewrite werkt niet? $ sudo nano /etc/apache2/sites-enabled/000-default AllowOverride None → AllowOverride All
  • 16. Apache ● “Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName” $ echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
  • 17. Apache ownership issues ● Op test (niet op live!!) omgeving: ● Apache draaien onder user “vagrant”: $ sudo nano /etc/apache2/envvars export APACHE_RUN_USER=vagrant export APACHE_RUN_GROUP=vagrant ● Restart Apache error? $ sudo rm -R /var/lock/apache2 ● Webroot & files toewijzen aan “vagrant”: ● $ sudo chown -R vagrant:vagrant /var/www/
  • 19. Database – MySQL ● Installatie MySQL $ sudo apt-get install mysql-server ● Secure MySQL $ sudo mysql_secure_installation ● Maak database voor Joomla CMS $ mysql -u root -p CREATE DATABASE joomla; SHOW DATABASES; q
  • 21. Server Script – PHP ● Installatie PHP + MySQL koppeling $ sudo apt-get install php5 php5-mysql ● Test: $ sudo nano /var/www/test.php <?php phpinfo(); ?>
  • 23. Database GUI – phpMyAdmin ● Installatie: $ sudo apt-get install phpmyadmin ● Browser: http://localhost:8080/phpmyadmin/
  • 25. Joomla ● Installatie: $ sudo wget http://joomlacode.org/gf/download/frsrelease/19340/158 535/Joomla_3.3.0.beta-Beta-Full_Package.zip ● Unzip: $ sudo unzip Joomla_3.3.0.beta-Beta- Update_Package.zip ● Browser: http://localhost:8080/joomla/
  • 26. Vragen? Peter Martin e-mail: info at db8.nl website: www.db8.nl twitter: @pe7er
  • 27. Used Photos ● Behind the Web - dreamguy http://www.freeimages.com/photo/107106 ● Carton empty box - humusak2 http://www.freeimages.com/photo/1440365 ● light bulb off - humusak2 http://www.freeimages.com/photo/1418476 ● Hiawatha (Little Golden Book) - DisneyWiki http://disney.wikia.com/wiki/Hiawatha_(Little_Golden_Book) ● lots of files 2 - Michael & Christa Richert http://www.freeimages.com/photo/1370555 ● Punch Card - Charles Toepfer http://www.freeimages.com/photo/262494 ● digital world - ilker http://www.freeimages.com/photo/1206711