SlideShare une entreprise Scribd logo
1  sur  39
Deploying a Web Application

         Thierry Sans
What you need



 Web Host       A home for your website




                A name for your website
 Domain Name
                www.myflippylocation.com
Web Hosting
Development Server vs Production Server




➡   Django provides a development server

๏   Does not scale with multiple requests (high threading)

✓   We need to setup a production server
Web Hosting


 Storage      How much space do you need?



 Bandwidth    How much traffic do you expect?



 Money        How much do you want to spend daily?
Do you want/need to manage ...

                Yes       physical            No
                      infrastructure?




     physical                           Yes        operating   No
      server                                        system?



                                  Virtual                       Share
                                  Private                       Web
                                  Server                        Host
source “The State of Web Development 2010”
                  from www.webdirections.org
Dedicated Physical Server



✓   Total Control

๏   Maintenance of the physical infrastructure

๏   Administration of the operating system

๏   Flexibility
Virtual Private Server (VPS)




๏   Administration of the operating system

✓   No maintenance of the physical infrastructure

✓   Flexibility (pay for what you need)
Shared Web Host




✓   No administration of the operating system

๏   Cost

๏   Not adequate for specific needs
Choosing the Technology
Choosing an operating system




               source “The State of Web Development 2010”
                                 from www.webdirections.org
Choosing a web server




               source “The State of Web Development 2010”
                                 from www.webdirections.org
Choosing a database




               source “The State of Web Development 2010”
                                 from www.webdirections.org
The popularity of LAMP



•   Linux

•   Apache

•   MySQL

•   Perl / PHP / Pyhton
Choosing a technology



•   Choosing a technology depends on

                        Specific applications that your web
      Specific needs
                        applications uses
                        What you are comfortable to
      Security
                        administer
Domain Name
Internet Top Level Names




•   See List of Internet top-level domains (Wikipedia)
How to get a domain name?


•   You need to buy one from a Domain Name Registrar
What about Qatar?




✓   A domain name in .qa

➡   See Qatar Domain Registry
Step 1 - Buy your domain name




•   Can be more or less expensive
Step 2 - Configure




➡   Attach an IP address (or another URL) to your domaine name
Django with Apache
The big picture

                                        Server Side
Client Side



                       mod_wsgi


                       myServlet.java
Web Browser

                                          Database
                   Web Server              Server
Apache and Python - 3 solutions



➡   How Apache runs Python code

•   mod_wsgi

•   FastCGI

•   Mod_python (deprecated)
Apache and Python - 3 solutions



➡   How Apache runs Python code

•   mod_wsgi

•   FastCGI

•   Mod_python (deprecated)
Apache and mod_wsgi



•   Apache

    http://www.apache.org/


•   Python WSGI adapter for Apache (mod_wsgi)

    http://code.google.com/p/modwsgi/
django.wsgi
Wsgi file and permissions                tsansweb/
                                            __init__.py
                                            manage.py
                                            settings.py
➡   Create a django.wsgi file                urls.py
                                            tsans.db
➡   Modify the permissions for Apache
                                            uploads/
$ chown -R :_www tsans-web                  WebGallery/

➡   Modify the permissions for Apache
$ chmod g+w tsansweb
$ chmod g+w tsansweb/tsans.db
django.wsgi
Wsgi file and permissions                tsansweb/
                                            __init__.py
                                            manage.py
                                            settings.py
➡   Create a django.wsgi file                urls.py
                                            tsans.db
➡   Modify the permissions for Apache
                                            uploads/
$ chown -R :_www tsans-web                  WebGallery/

➡   Modify the permissions for Apache      _www for Mac OS
                                           www-data for Linux
$ chmod g+w tsansweb
$ chmod g+w tsansweb/tsans.db
Django WSGI file (Django version 1.3)                    django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)


path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Django WSGI file (Django version 1.3)                    django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)
                            Django project path
path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Django WSGI file (Django version 1.3)                      django.wsgi
import os
import sys


path = os.path.abspath(os.path.dirname(__file__))
if path not in sys.path:
    sys.path.append(path)
                            Django project path
path+="/tsansweb"
if path not in sys.path:
    sys.path.append(path)
                                                    Settings module


os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings'


import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
httpd.conf (Apache)                         /etc/apache2/httpd.conf




....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
httpd.conf (Apache)                          /etc/apache2/httpd.conf




                                 path to the wsgi module
....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
httpd.conf (Apache)                            /etc/apache2/httpd.conf




                                  path to the wsgi module
....


LoadModule wsgi_module    libexec/apache2/mod_wsgi.so


WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi


....
                              path to your wsgi file
Django and MySQL
MySQL




•   MySQL

    http://www.mysql.com/
Configure Django for MySQL


                                                              tsansweb/settings.py
....
DATABASES = {
    'default': {
      'ENGINE':   'django.db.backends.mysql',
      'USER':     'Django',
      'PASSWORD': 'Pass4Django',
      'HOST': '',      # Set to empty string for localhost.
      'PORT': '',      # Set to empty string for default.
      }
}

....
Configure Django for MySQL


                                                               tsansweb/settings.py
....
DATABASES = {
    'default': {
      'ENGINE':
      'USER':
                  'django.db.backends.mysql',
                  'Django',
                                                MySQL user and password
      'PASSWORD': 'Pass4Django',
      'HOST': '',      # Set to empty string for localhost.
      'PORT': '',      # Set to empty string for default.
      }
}

....

Contenu connexe

Tendances

Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Kris Wallsmith
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Jacob Kaplan-Moss
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
Even faster django
Even faster djangoEven faster django
Even faster djangoGage Tseng
 
Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Chetan Padia
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryRemy Sharp
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 

Tendances (20)

Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3Introducing Assetic: Asset Management for PHP 5.3
Introducing Assetic: Asset Management for PHP 5.3
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Presentation
PresentationPresentation
Presentation
 
Jsp
JspJsp
Jsp
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Geotalk presentation
Geotalk presentationGeotalk presentation
Geotalk presentation
 
YouDrup_in_Drupal
YouDrup_in_DrupalYouDrup_in_Drupal
YouDrup_in_Drupal
 
RicoLiveGrid
RicoLiveGridRicoLiveGrid
RicoLiveGrid
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Even faster django
Even faster djangoEven faster django
Even faster django
 
Odoo - CMS performances optimization
Odoo - CMS performances optimizationOdoo - CMS performances optimization
Odoo - CMS performances optimization
 
YUI on the go
YUI on the goYUI on the go
YUI on the go
 
Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017Beeline Firebase talk - Firebase event Jun 2017
Beeline Firebase talk - Firebase event Jun 2017
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 

Similaire à Deploying

“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.Graham Dumpleton
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.Graham Dumpleton
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformWSO2
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp HamiltonPaul Bearne
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukMarcinStachniuk
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaSAppsembler
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2Yros
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passengerdavidchubbs
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...LumoSpark
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 

Similaire à Deploying (20)

“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
 
Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin Stachniuk
 
Django deployment with PaaS
Django deployment with PaaSDjango deployment with PaaS
Django deployment with PaaS
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Django
DjangoDjango
Django
 
Running Node.js in Production using Passenger
Running Node.js in Production using PassengerRunning Node.js in Production using Passenger
Running Node.js in Production using Passenger
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
Deployment talk dpc 13
Deployment talk dpc 13Deployment talk dpc 13
Deployment talk dpc 13
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
🐬 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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Deploying

  • 1. Deploying a Web Application Thierry Sans
  • 2. What you need Web Host A home for your website A name for your website Domain Name www.myflippylocation.com
  • 4. Development Server vs Production Server ➡ Django provides a development server ๏ Does not scale with multiple requests (high threading) ✓ We need to setup a production server
  • 5. Web Hosting Storage How much space do you need? Bandwidth How much traffic do you expect? Money How much do you want to spend daily?
  • 6. Do you want/need to manage ... Yes physical No infrastructure? physical Yes operating No server system? Virtual Share Private Web Server Host
  • 7. source “The State of Web Development 2010” from www.webdirections.org
  • 8. Dedicated Physical Server ✓ Total Control ๏ Maintenance of the physical infrastructure ๏ Administration of the operating system ๏ Flexibility
  • 9. Virtual Private Server (VPS) ๏ Administration of the operating system ✓ No maintenance of the physical infrastructure ✓ Flexibility (pay for what you need)
  • 10. Shared Web Host ✓ No administration of the operating system ๏ Cost ๏ Not adequate for specific needs
  • 12. Choosing an operating system source “The State of Web Development 2010” from www.webdirections.org
  • 13. Choosing a web server source “The State of Web Development 2010” from www.webdirections.org
  • 14. Choosing a database source “The State of Web Development 2010” from www.webdirections.org
  • 15. The popularity of LAMP • Linux • Apache • MySQL • Perl / PHP / Pyhton
  • 16. Choosing a technology • Choosing a technology depends on Specific applications that your web Specific needs applications uses What you are comfortable to Security administer
  • 18. Internet Top Level Names • See List of Internet top-level domains (Wikipedia)
  • 19. How to get a domain name? • You need to buy one from a Domain Name Registrar
  • 20. What about Qatar? ✓ A domain name in .qa ➡ See Qatar Domain Registry
  • 21. Step 1 - Buy your domain name • Can be more or less expensive
  • 22. Step 2 - Configure ➡ Attach an IP address (or another URL) to your domaine name
  • 24. The big picture Server Side Client Side mod_wsgi myServlet.java Web Browser Database Web Server Server
  • 25. Apache and Python - 3 solutions ➡ How Apache runs Python code • mod_wsgi • FastCGI • Mod_python (deprecated)
  • 26. Apache and Python - 3 solutions ➡ How Apache runs Python code • mod_wsgi • FastCGI • Mod_python (deprecated)
  • 27. Apache and mod_wsgi • Apache http://www.apache.org/ • Python WSGI adapter for Apache (mod_wsgi) http://code.google.com/p/modwsgi/
  • 28. django.wsgi Wsgi file and permissions tsansweb/ __init__.py manage.py settings.py ➡ Create a django.wsgi file urls.py tsans.db ➡ Modify the permissions for Apache uploads/ $ chown -R :_www tsans-web WebGallery/ ➡ Modify the permissions for Apache $ chmod g+w tsansweb $ chmod g+w tsansweb/tsans.db
  • 29. django.wsgi Wsgi file and permissions tsansweb/ __init__.py manage.py settings.py ➡ Create a django.wsgi file urls.py tsans.db ➡ Modify the permissions for Apache uploads/ $ chown -R :_www tsans-web WebGallery/ ➡ Modify the permissions for Apache _www for Mac OS www-data for Linux $ chmod g+w tsansweb $ chmod g+w tsansweb/tsans.db
  • 30. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) path+="/tsansweb" if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 31. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) Django project path path+="/tsansweb" if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 32. Django WSGI file (Django version 1.3) django.wsgi import os import sys path = os.path.abspath(os.path.dirname(__file__)) if path not in sys.path: sys.path.append(path) Django project path path+="/tsansweb" if path not in sys.path: sys.path.append(path) Settings module os.environ['DJANGO_SETTINGS_MODULE'] = 'tsansweb.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
  • 33. httpd.conf (Apache) /etc/apache2/httpd.conf .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi ....
  • 34. httpd.conf (Apache) /etc/apache2/httpd.conf path to the wsgi module .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi ....
  • 35. httpd.conf (Apache) /etc/apache2/httpd.conf path to the wsgi module .... LoadModule wsgi_module libexec/apache2/mod_wsgi.so WSGIScriptAlias / /Users/tsans/Sites/tsansweb.wsgi .... path to your wsgi file
  • 37. MySQL • MySQL http://www.mysql.com/
  • 38. Configure Django for MySQL tsansweb/settings.py .... DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'USER': 'Django', 'PASSWORD': 'Pass4Django', 'HOST': '', # Set to empty string for localhost. 'PORT': '', # Set to empty string for default. } } ....
  • 39. Configure Django for MySQL tsansweb/settings.py .... DATABASES = { 'default': { 'ENGINE': 'USER': 'django.db.backends.mysql', 'Django', MySQL user and password 'PASSWORD': 'Pass4Django', 'HOST': '', # Set to empty string for localhost. 'PORT': '', # Set to empty string for default. } } ....

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n