SlideShare ist ein Scribd-Unternehmen logo
1 von 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.
      }
}

....

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
🐬 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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Kürzlich hochgeladen (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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. } } ....

Hinweis der Redaktion

  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