SlideShare a Scribd company logo
1 of 31
Download to read offline
#BURNINGKEYBOARDS
DENIS.RISTIC@PERPETUUM.HR
LAMP STACK
LAMP STACK
INTRO
‣ Simply exploding the acronym on a letter by letter
basis gives us the following elements:
‣ Linux
‣ Apache Web server
‣ MySQL database
‣ PHP
3
LAMP STACK
APACHE WEB SERVER
‣ The Apache HTTP Server Project is an effort to develop
and maintain an open-source HTTP server for modern
operating systems including UNIX and Windows.
‣ The goal of this project is to provide a secure, efficient
and extensible server that provides HTTP services in
sync with the current HTTP standards.
4
LAMP STACK
HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER?
‣ PHP is an interpreted language.
‣ This means that you will write code statements (lines of
code) and when a page is requested, the PHP
interpreter will load your PHP code, parse it and then
execute it.
‣ This is useful for web development in the fact that you
do not have to re-compile your source code for trivial
code changes and the changes have immediate effect
on all subsequent requests.
5
LAMP STACK
HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER?
‣ PHP is written as standard text files with the .php
extension.
‣ PHP files are often saved within a folder in a web server’s
public directory (or a web root directory).
‣ On most systems this will either be named public or
public_html.
‣ For example, if a file was saved as index.php in a web root
directory, a user could access it by typing http://
www.example.org or http://www.example.org/
index.php.
6
LAMP STACK
HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER?
‣ When Apache determines that the request is for a PHP
script rather than a static file, PHP sends the request to
PHP-FPM.
‣ PHP-FPM is the modern PHP FastCGI process manager
that is included with PHP. Each of your apps has its own
PHP process pool. Each process in the app's process
pool runs as the system user your app belongs to.
‣ Once PHP finishes processing the request, the
response goes back through Apache and then to the
browser.
7
LAMP STACK
APACHE VIRTUAL HOSTS
‣ Virtual hosts are the bread and butter of Apache.
‣ They allow you to run multiple websites off of one web
server as well as customize settings for each site.
8
LAMP STACK
.HTACCESS
‣ .htaccess files provide a way to make configuration
changes on a per-directory basis.
9
LAMP STACK
PHP-FPM
‣ PHP-FPM (FastCGI Process Manager) is an alternative
PHP FastCGI implementation with some additional
features useful for sites of any size, especially busier
sites.
10
LAMP STACK
SCALABILITY
‣ Basically there are two approaches to scalability:
‣ Vertical: basically buying the biggest machine you
can so you don't need more than one;
‣ Horizontal: doing things in a way that lends itself to
parallelism. Only needed on the most intensive of
applications.
11
LAMP STACK
SCALABILITY BOTLENECKS
‣ If your database is slowing things down either give it more resources
or use some form of in-memory caching to take the load off;
‣ If disk I/O is your problem then the same applies;
‣ If you're running out of memory to the point where it's causing too
many page faults and thus causing a disk I/O problem, add more
memory;
‣ Does your application and it's data lend itself to partitiioning across
servers? If so, that's one way of scaling horizontally;
‣ If bandwidth is an issue and you're delivering large files then
perhaps a CDN is the answer;
‣ And so on…
12
LAMP STACK
SHARED HOSTING
‣ One web server and one database on same machine
‣ Application designed for one machine
13
LAMP STACK
TWO SERVERS
‣ Web server and database on different machines
‣ Minimal changes to code
14
LAMP STACK
SCALING THE DATABASE
‣ Setup MySQL replication
‣ Minimal changes to code
15
LAMP STACK
SCALING THE DATABASE 2
‣ DB more suited for equal read/write applications
‣ Minimal changes to code
16
LAMP STACK
SCALING THE WEB SERVER
‣ Web server is made of “worker threads” that process
work as they come in
17
LAMP STACK
LOAD BALANCING
‣ Load balancing refers to efficiently distributing
incoming network traffic across a group of backend
servers, also known as a server farm or server pool.
18
LAMP STACK
THE STORY SO FAR
19
LAMP STACK
WHAT MORE CAN WE DO?
‣ Use MariaDB
‣ One of the most popular database servers. Made by the
original developers of MySQL. Guaranteed to stay open
source.
‣ Without the query cache enabled, MariaDB had 10% better
performance up to 20 concurrent connections, while MySQL
was 25% better at 220 connections at the same time.
‣ When query cache was enabled, MariaDB was a clean winner
on all connection numbers, having more than 50% better
performance than MySQL on 220 concurrent connections.
20
LAMP STACK
WHAT MORE CAN WE DO?
‣ Use Varnish Cache
‣ Varnish Cache is a web application accelerator also
known as a caching HTTP reverse proxy. You install it
in front of any server that speaks HTTP and configure
it to cache the contents. Varnish Cache is really, really
fast. It typically speeds up delivery with a factor of
300 - 1000x, depending on your architecture.
21
LAMP STACK
WHAT MORE CAN WE DO?
‣ Use nginx for serving static content
‣ Nginx is a web server, which can also be used as a
reverse proxy, load balancer and HTTP cache.
22
LAMP STACK
WHAT MORE CAN WE DO?
‣ Use Redis for object & session caching
‣ Redis is an open source, in-memory data structure store, used as a
database, cache and message broker. It supports data structures
such as strings, hashes, lists, sets, sorted sets with range queries,
bitmaps, hyperloglogs and geospatial indexes with radius queries.
‣ The session handler is responsible for storing and retrieving data
saved into sessions - by default, PHP uses files for that.
‣ An external session handler can be used for creating faster and
scalable PHP environments behind a load balancer, where all
application nodes will connect to a central server to share session
information.
23
LAMP STACK
WHAT MORE CAN WE DO?
‣ Use CDN
‣ A content delivery network or content distribution network
(CDN) is a geographically distributed network of proxy
servers and their data centers.
‣ The goal is to distribute service spatially relative to end-users
to provide high availability and high performance.
‣ CDNs serve a large fraction of the Internet content today,
including web objects (text, graphics and scripts),
downloadable objects (media files, software, documents),
applications (e-commerce, portals), live streaming media, on-
demand streaming media, and social networks.
24
LAMP STACK
RESOURCE MANAGEMENT
‣ Balance how you use hardware
‣ Use memory to save CPU and/or IO
‣ Balance your resource use (CPU vs RAM vs IO)
‣ Check configurations and optimize them periodically
‣ Test and measure performance
25
LAMP STACK
INSTALLING LAMP ON CENTOS (EXAMPLE)
sudo hostnamectl set-hostname burningkeyboards.com
hostname
sudo timedatectl set-timezone 'Europe/Zagreb'
date
sudo yum update
sudo yum upgrade
26
LAMP STACK
INSTALLING LAMP ON CENTOS (EXAMPLE)
sudo yum install httpd
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf/httpd.conf.backup
mkdir /etc/httpd/conf.d
nano /etc/httpd/conf.d/vhost.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@burningkeyboards.com
ServerName burningkeyboards.com
ServerAlias www.burningkeyboards.com
DocumentRoot /var/www/burningkeyboards.com/public_html/
ErrorLog /var/www/burningkeyboards.com/logs/error.log
CustomLog /var/www/burningkeyboards.com/logs/access.log combined
</VirtualHost>
sudo mkdir -p /var/www/burningkeyboards.com/{public_html,logs}
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl enable httpd.service
sudo systemctl restart httpd.service
27
LAMP STACK
INSTALLING LAMP ON CENTOS (EXAMPLE)
sudo yum install mariadb-server
sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service
sudo mysql_secure_installation
mysql -u root -p
create database burningkeyboards;
grant all on burningkeyboards.* to 'bkdbuser' identified by
'********';
quit
28
LAMP STACK
INSTALLING LAMP ON CENTOS (EXAMPLE)
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-
latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum search php
sudo yum install php71w php71w-fpm php71w-common php71w-cli php71w-pear
php71w-mysql php71w-mcrypt php71w-intl php71w-gd php71w-mysql php71w-pdo
nano /etc/php.ini
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|
E_CORE_ERROR
error_log = /var/log/php/error.log
max_input_time = 30
sudo mkdir /var/log/php
sudo chown apache /var/log/php
sudo systemctl reload httpd
29
LAMP STACK
INSTALLING LAMP ON CENTOS (EXAMPLE)
nano /var/www/burningkeyboards.com/index.php
<?php phpinfo(); ?>
30
LAMP STACK
LAMP RESOURCES
‣ Apache
‣ https://httpd.apache.org/
‣ nginx
‣ https://www.nginx.com/
‣ MariaDB
‣ https://mariadb.org/
‣ Varnish
‣ https://varnish-cache.org/
‣ Redis
‣ https://redis.io/
‣ HA Proxy
‣ http://www.haproxy.org/
31

More Related Content

What's hot

WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to EverythingWordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everythingtopher1kenobe
 
Apache Phoenix: Use Cases and New Features
Apache Phoenix: Use Cases and New FeaturesApache Phoenix: Use Cases and New Features
Apache Phoenix: Use Cases and New FeaturesHBaseCon
 
Codeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkCodeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkTimothy Spann
 
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCF
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCFMongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCF
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCFMongoDB
 
ApacheCon 2021 - Apache NiFi Deep Dive 300
ApacheCon 2021 - Apache NiFi Deep Dive 300ApacheCon 2021 - Apache NiFi Deep Dive 300
ApacheCon 2021 - Apache NiFi Deep Dive 300Timothy Spann
 
lamp technology
lamp technologylamp technology
lamp technologyDeepa
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeTimothy Spann
 
20120329 installing wordpress_3_3_1_locally
20120329 installing wordpress_3_3_1_locally20120329 installing wordpress_3_3_1_locally
20120329 installing wordpress_3_3_1_locallyDERlab
 
Speedup your WordPress mit Nginx und HTTP/2
Speedup your WordPress mit Nginx und HTTP/2Speedup your WordPress mit Nginx und HTTP/2
Speedup your WordPress mit Nginx und HTTP/2wpmeetupka
 
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...confluent
 
Modern Application Stacks
Modern Application StacksModern Application Stacks
Modern Application Stackschartjes
 
Real Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & CouchbaseReal Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & CouchbaseManuel Hurtado
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceValeri Karpov
 
DBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data LakesDBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data LakesTimothy Spann
 
Kafka & Couchbase Integration Patterns
Kafka & Couchbase Integration PatternsKafka & Couchbase Integration Patterns
Kafka & Couchbase Integration PatternsManuel Hurtado
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...Timothy Spann
 

What's hot (19)

WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to EverythingWordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
 
Apache Phoenix: Use Cases and New Features
Apache Phoenix: Use Cases and New FeaturesApache Phoenix: Use Cases and New Features
Apache Phoenix: Use Cases and New Features
 
Codeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkCodeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flink
 
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCF
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCFMongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCF
MongoDB Europe 2016 - MongoDB, Ops Manager & Docker at SNCF
 
ApacheCon 2021 - Apache NiFi Deep Dive 300
ApacheCon 2021 - Apache NiFi Deep Dive 300ApacheCon 2021 - Apache NiFi Deep Dive 300
ApacheCon 2021 - Apache NiFi Deep Dive 300
 
FLiP Into Trino
FLiP Into TrinoFLiP Into Trino
FLiP Into Trino
 
lamp technology
lamp technologylamp technology
lamp technology
 
Laravel
LaravelLaravel
Laravel
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lake
 
20120329 installing wordpress_3_3_1_locally
20120329 installing wordpress_3_3_1_locally20120329 installing wordpress_3_3_1_locally
20120329 installing wordpress_3_3_1_locally
 
Speedup your WordPress mit Nginx und HTTP/2
Speedup your WordPress mit Nginx und HTTP/2Speedup your WordPress mit Nginx und HTTP/2
Speedup your WordPress mit Nginx und HTTP/2
 
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...
The Good, The Bad, and The Avro (Graham Stirling, Saxo Bank and David Navalho...
 
Modern Application Stacks
Modern Application StacksModern Application Stacks
Modern Application Stacks
 
Real Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & CouchbaseReal Time Streaming with Flink & Couchbase
Real Time Streaming with Flink & Couchbase
 
A Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-ServiceA Practical Introduction to Functions-as-a-Service
A Practical Introduction to Functions-as-a-Service
 
DBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data LakesDBCC 2021 - FLiP Stack for Cloud Data Lakes
DBCC 2021 - FLiP Stack for Cloud Data Lakes
 
Kafka & Couchbase Integration Patterns
Kafka & Couchbase Integration PatternsKafka & Couchbase Integration Patterns
Kafka & Couchbase Integration Patterns
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
 

Similar to 23 LAMP Stack #burningkeyboards

OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...NETWAYS
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Web server hardware and software
Web server hardware and softwareWeb server hardware and software
Web server hardware and softwareVikram g b
 
lamp-technology-8860-9KNDvBR.pptx
lamp-technology-8860-9KNDvBR.pptxlamp-technology-8860-9KNDvBR.pptx
lamp-technology-8860-9KNDvBR.pptxManikanta191485
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 
Denser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversDenser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversJez Halford
 
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglas
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin DunglasINTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglas
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglasapidays
 
Web servers presentacion
Web servers presentacionWeb servers presentacion
Web servers presentacionKiwi Science
 
Visual Mapping of Clickstream Data
Visual Mapping of Clickstream DataVisual Mapping of Clickstream Data
Visual Mapping of Clickstream DataDataWorks Summit
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQLGanesh Kamath
 
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)grantnorwood
 
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)Grant Norwood
 
Apache web-server-architecture
Apache web-server-architectureApache web-server-architecture
Apache web-server-architectureIvanGeorgeArouje
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebservertarensi
 

Similar to 23 LAMP Stack #burningkeyboards (20)

Apache web service
Apache web serviceApache web service
Apache web service
 
App Deployment on Cloud
App Deployment on CloudApp Deployment on Cloud
App Deployment on Cloud
 
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
OSMC 2023 | IGNITE: Serving Server-Side WASM with Web Awareness with NGINX Un...
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
2016 03 15_biological_databases_part4
2016 03 15_biological_databases_part42016 03 15_biological_databases_part4
2016 03 15_biological_databases_part4
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
 
Web server hardware and software
Web server hardware and softwareWeb server hardware and software
Web server hardware and software
 
lamp-technology-8860-9KNDvBR.pptx
lamp-technology-8860-9KNDvBR.pptxlamp-technology-8860-9KNDvBR.pptx
lamp-technology-8860-9KNDvBR.pptx
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
Denser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microserversDenser, cooler, faster, stronger: PHP on ARM microservers
Denser, cooler, faster, stronger: PHP on ARM microservers
 
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglas
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin DunglasINTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglas
INTERFACE by apidays_Vulcain: beat GraphQL with HTTP/2+ by Kevin Dunglas
 
Web servers presentacion
Web servers presentacionWeb servers presentacion
Web servers presentacion
 
Visual Mapping of Clickstream Data
Visual Mapping of Clickstream DataVisual Mapping of Clickstream Data
Visual Mapping of Clickstream Data
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
 
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
Cluster Fudge: Recipes for WordPress in the Cloud (WordCamp Austin 2014 Speaker)
 
Apache web-server-architecture
Apache web-server-architectureApache web-server-architecture
Apache web-server-architecture
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver
 

More from Denis Ristic

Magento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRMagento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRDenis Ristic
 
Continuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzContinuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzDenis Ristic
 
25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboardsDenis Ristic
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboardsDenis Ristic
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboardsDenis Ristic
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboardsDenis Ristic
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboardsDenis Ristic
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboardsDenis Ristic
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboardsDenis Ristic
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboardsDenis Ristic
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboardsDenis Ristic
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboardsDenis Ristic
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboardsDenis Ristic
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboardsDenis Ristic
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboardsDenis Ristic
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboardsDenis Ristic
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboardsDenis Ristic
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboardsDenis Ristic
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboardsDenis Ristic
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboardsDenis Ristic
 

More from Denis Ristic (20)

Magento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRMagento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HR
 
Continuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzContinuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVz
 
25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards25 Intro to Symfony #burningkeyboards
25 Intro to Symfony #burningkeyboards
 
24 Scrum #burningkeyboards
24 Scrum #burningkeyboards24 Scrum #burningkeyboards
24 Scrum #burningkeyboards
 
22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards22 REST & JSON API Design #burningkeyboards
22 REST & JSON API Design #burningkeyboards
 
21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
 
20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards20 PHP Static Analysis and Documentation Generators #burningkeyboards
20 PHP Static Analysis and Documentation Generators #burningkeyboards
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
 
18 Git #burningkeyboards
18 Git #burningkeyboards18 Git #burningkeyboards
18 Git #burningkeyboards
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards16 MySQL Optimization #burningkeyboards
16 MySQL Optimization #burningkeyboards
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
 
14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards14 Dependency Injection #burningkeyboards
14 Dependency Injection #burningkeyboards
 
13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards13 PHPUnit #burningkeyboards
13 PHPUnit #burningkeyboards
 
12 Composer #burningkeyboards
12 Composer #burningkeyboards12 Composer #burningkeyboards
12 Composer #burningkeyboards
 
11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards11 PHP Security #burningkeyboards
11 PHP Security #burningkeyboards
 
10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards10 PHP Design Patterns #burningkeyboards
10 PHP Design Patterns #burningkeyboards
 
09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards09 Object Oriented Programming in PHP #burningkeyboards
09 Object Oriented Programming in PHP #burningkeyboards
 
08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards08 Advanced PHP #burningkeyboards
08 Advanced PHP #burningkeyboards
 
07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards07 Introduction to PHP #burningkeyboards
07 Introduction to PHP #burningkeyboards
 

Recently uploaded

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

23 LAMP Stack #burningkeyboards

  • 3. LAMP STACK INTRO ‣ Simply exploding the acronym on a letter by letter basis gives us the following elements: ‣ Linux ‣ Apache Web server ‣ MySQL database ‣ PHP 3
  • 4. LAMP STACK APACHE WEB SERVER ‣ The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows. ‣ The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. 4
  • 5. LAMP STACK HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER? ‣ PHP is an interpreted language. ‣ This means that you will write code statements (lines of code) and when a page is requested, the PHP interpreter will load your PHP code, parse it and then execute it. ‣ This is useful for web development in the fact that you do not have to re-compile your source code for trivial code changes and the changes have immediate effect on all subsequent requests. 5
  • 6. LAMP STACK HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER? ‣ PHP is written as standard text files with the .php extension. ‣ PHP files are often saved within a folder in a web server’s public directory (or a web root directory). ‣ On most systems this will either be named public or public_html. ‣ For example, if a file was saved as index.php in a web root directory, a user could access it by typing http:// www.example.org or http://www.example.org/ index.php. 6
  • 7. LAMP STACK HOW DOES PHP WORK WITH THE WEB SERVER AND BROWSER? ‣ When Apache determines that the request is for a PHP script rather than a static file, PHP sends the request to PHP-FPM. ‣ PHP-FPM is the modern PHP FastCGI process manager that is included with PHP. Each of your apps has its own PHP process pool. Each process in the app's process pool runs as the system user your app belongs to. ‣ Once PHP finishes processing the request, the response goes back through Apache and then to the browser. 7
  • 8. LAMP STACK APACHE VIRTUAL HOSTS ‣ Virtual hosts are the bread and butter of Apache. ‣ They allow you to run multiple websites off of one web server as well as customize settings for each site. 8
  • 9. LAMP STACK .HTACCESS ‣ .htaccess files provide a way to make configuration changes on a per-directory basis. 9
  • 10. LAMP STACK PHP-FPM ‣ PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. 10
  • 11. LAMP STACK SCALABILITY ‣ Basically there are two approaches to scalability: ‣ Vertical: basically buying the biggest machine you can so you don't need more than one; ‣ Horizontal: doing things in a way that lends itself to parallelism. Only needed on the most intensive of applications. 11
  • 12. LAMP STACK SCALABILITY BOTLENECKS ‣ If your database is slowing things down either give it more resources or use some form of in-memory caching to take the load off; ‣ If disk I/O is your problem then the same applies; ‣ If you're running out of memory to the point where it's causing too many page faults and thus causing a disk I/O problem, add more memory; ‣ Does your application and it's data lend itself to partitiioning across servers? If so, that's one way of scaling horizontally; ‣ If bandwidth is an issue and you're delivering large files then perhaps a CDN is the answer; ‣ And so on… 12
  • 13. LAMP STACK SHARED HOSTING ‣ One web server and one database on same machine ‣ Application designed for one machine 13
  • 14. LAMP STACK TWO SERVERS ‣ Web server and database on different machines ‣ Minimal changes to code 14
  • 15. LAMP STACK SCALING THE DATABASE ‣ Setup MySQL replication ‣ Minimal changes to code 15
  • 16. LAMP STACK SCALING THE DATABASE 2 ‣ DB more suited for equal read/write applications ‣ Minimal changes to code 16
  • 17. LAMP STACK SCALING THE WEB SERVER ‣ Web server is made of “worker threads” that process work as they come in 17
  • 18. LAMP STACK LOAD BALANCING ‣ Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers, also known as a server farm or server pool. 18
  • 19. LAMP STACK THE STORY SO FAR 19
  • 20. LAMP STACK WHAT MORE CAN WE DO? ‣ Use MariaDB ‣ One of the most popular database servers. Made by the original developers of MySQL. Guaranteed to stay open source. ‣ Without the query cache enabled, MariaDB had 10% better performance up to 20 concurrent connections, while MySQL was 25% better at 220 connections at the same time. ‣ When query cache was enabled, MariaDB was a clean winner on all connection numbers, having more than 50% better performance than MySQL on 220 concurrent connections. 20
  • 21. LAMP STACK WHAT MORE CAN WE DO? ‣ Use Varnish Cache ‣ Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture. 21
  • 22. LAMP STACK WHAT MORE CAN WE DO? ‣ Use nginx for serving static content ‣ Nginx is a web server, which can also be used as a reverse proxy, load balancer and HTTP cache. 22
  • 23. LAMP STACK WHAT MORE CAN WE DO? ‣ Use Redis for object & session caching ‣ Redis is an open source, in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. ‣ The session handler is responsible for storing and retrieving data saved into sessions - by default, PHP uses files for that. ‣ An external session handler can be used for creating faster and scalable PHP environments behind a load balancer, where all application nodes will connect to a central server to share session information. 23
  • 24. LAMP STACK WHAT MORE CAN WE DO? ‣ Use CDN ‣ A content delivery network or content distribution network (CDN) is a geographically distributed network of proxy servers and their data centers. ‣ The goal is to distribute service spatially relative to end-users to provide high availability and high performance. ‣ CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on- demand streaming media, and social networks. 24
  • 25. LAMP STACK RESOURCE MANAGEMENT ‣ Balance how you use hardware ‣ Use memory to save CPU and/or IO ‣ Balance your resource use (CPU vs RAM vs IO) ‣ Check configurations and optimize them periodically ‣ Test and measure performance 25
  • 26. LAMP STACK INSTALLING LAMP ON CENTOS (EXAMPLE) sudo hostnamectl set-hostname burningkeyboards.com hostname sudo timedatectl set-timezone 'Europe/Zagreb' date sudo yum update sudo yum upgrade 26
  • 27. LAMP STACK INSTALLING LAMP ON CENTOS (EXAMPLE) sudo yum install httpd cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf/httpd.conf.backup mkdir /etc/httpd/conf.d nano /etc/httpd/conf.d/vhost.conf NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@burningkeyboards.com ServerName burningkeyboards.com ServerAlias www.burningkeyboards.com DocumentRoot /var/www/burningkeyboards.com/public_html/ ErrorLog /var/www/burningkeyboards.com/logs/error.log CustomLog /var/www/burningkeyboards.com/logs/access.log combined </VirtualHost> sudo mkdir -p /var/www/burningkeyboards.com/{public_html,logs} sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload sudo systemctl enable httpd.service sudo systemctl restart httpd.service 27
  • 28. LAMP STACK INSTALLING LAMP ON CENTOS (EXAMPLE) sudo yum install mariadb-server sudo systemctl enable mariadb.service sudo systemctl start mariadb.service sudo mysql_secure_installation mysql -u root -p create database burningkeyboards; grant all on burningkeyboards.* to 'bkdbuser' identified by '********'; quit 28
  • 29. LAMP STACK INSTALLING LAMP ON CENTOS (EXAMPLE) rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release- latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum search php sudo yum install php71w php71w-fpm php71w-common php71w-cli php71w-pear php71w-mysql php71w-mcrypt php71w-intl php71w-gd php71w-mysql php71w-pdo nano /etc/php.ini error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR| E_CORE_ERROR error_log = /var/log/php/error.log max_input_time = 30 sudo mkdir /var/log/php sudo chown apache /var/log/php sudo systemctl reload httpd 29
  • 30. LAMP STACK INSTALLING LAMP ON CENTOS (EXAMPLE) nano /var/www/burningkeyboards.com/index.php <?php phpinfo(); ?> 30
  • 31. LAMP STACK LAMP RESOURCES ‣ Apache ‣ https://httpd.apache.org/ ‣ nginx ‣ https://www.nginx.com/ ‣ MariaDB ‣ https://mariadb.org/ ‣ Varnish ‣ https://varnish-cache.org/ ‣ Redis ‣ https://redis.io/ ‣ HA Proxy ‣ http://www.haproxy.org/ 31
  • 32. LAMP STACK LAMP RESOURCES ‣ Setup LAMP on Debian/Ubuntu ‣ https://www.digitalocean.com/community/tutorials/how- to-install-linux-apache-mysql-php-lamp-stack-on-debian ‣ https://www.linode.com/docs/web-servers/lamp/lamp-on- debian-8-jessie ‣ Setup LAMP on Centos ‣ https://www.digitalocean.com/community/tutorials/how- to-install-linux-apache-mysql-php-lamp-stack-on-centos-7 ‣ https://www.linode.com/docs/web-servers/lamp/lamp-on- centos-7 32