Preview

Virtual Host in Play Framework

Good Essays
Open Document
Open Document
725 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Virtual Host in Play Framework
n play fr
Set-up a front-end HTTP server
You can easily deploy your application as a stand-alone server by setting the application HTTP port to 80:
%production.http.port=80
But if you plan to host several applications in the same server or load balance several instances of your application for scalability or fault tolerance, you can use a front-end HTTP server.
Note that using a front-end HTTP server will never give you better performance than using Play server directly!
Set-up with lighttpd
This example shows you how to configure lighttpd as a front-end web server. Note that you can do the same with Apache, but if you only need virtual hosting or load balancing, lighttpd is a very good choice and much easier to configure!
The /etc/lighttpd/lighttpd.conf file should define things like this: server.modules = ( "mod_access", "mod_proxy", "mod_accesslog"
)
...
$HTTP["host"] =~ "www.myapp.com" { proxy.balance = "round-robin" proxy.server = ( "/" => ( ( "host" => "127.0.0.1", "port" => 9000 ) ) )
}

$HTTP["host"] =~ "www.loadbalancedapp.com" { proxy.balance = "round-robin" proxy.server = ( "/" => ( ( "host" => "127.0.0.1", "port" => 9000 ), ( "host" => "127.0.0.1", "port" => 9001 ) ) )
}
Set-up with Apache
The example below shows a simple set-up with Apache httpd server running in front of a standard Play configuration.
LoadModule proxy_module modules/mod_proxy.so
...

ProxyPreserveHost On ServerName www.loadbalancedapp.com ProxyPass / http://127.0.0.1:9000/ ProxyPassReverse / http://127.0.0.1:9000/

Apache as a front proxy to allow transparent upgrade of your application
The basic idea is to run 2 Play instances of your web application and let the front-end proxy load-balance them. In case one is not available, it will forward all the requests to the available one.
Let’s start the same Play application two times: one on port 9999 and one on port 9998.
Copy the

You May Also Find These Documents Helpful

  • Good Essays

    Nt1330 Unit 1 Case Study

    • 776 Words
    • 4 Pages

    Managing, maintaining, and modifying applications is easier, since only the web application on the server-side needs to be updated.…

    • 776 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Applications in the enterprise come in different forms, client run apps, client/server apps, and distributed apps.…

    • 431 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1330 Unit 3 Lab Report

    • 1967 Words
    • 8 Pages

    Create an Apache Web Server installation and perform basic security configurations to assure that the system has been hardened…

    • 1967 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    nt1230

    • 905 Words
    • 6 Pages

    Because this is only a test deployment, you will be using a Windows 7 computer to function as the web server. In Exercise 5.1 you install Internet Information Services on your workstation and configure it to host two web sites.…

    • 905 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Router Simulation

    • 331 Words
    • 2 Pages

    10. What do you believe would be the result of installing and configuring a web server to “listen” on ports other than 80 and 443? 8080…

    • 331 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1210 Network Essay

    • 618 Words
    • 3 Pages

    3 types of servers are FTP, web, and application server. A file transfer protocol server is used to secure transfer files between 2 computers while providing ease of use (transfer protocols). A web server serves content to the web browser and allows the content to be displayed on user web browsers, all done with the aid of http. Lastly, an application server hold a lot of data that connect to the both the user and a database usually to access data, update data or remove data.…

    • 618 Words
    • 3 Pages
    Good Essays
  • Good Essays

    i. Application – Defines the applications used to process requests and what ports and sockets are used.…

    • 890 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Module 2

    • 5116 Words
    • 21 Pages

    Web services are client and server applications that communicate over the World Wide Web’s (WWW) by using Hyper Text Transfer Protocol (HTTP). Web services provide a standard means of interoperating between software applications running on a variety of platforms and frameworks. It has two participants:…

    • 5116 Words
    • 21 Pages
    Satisfactory Essays
  • Good Essays

    Because this is only a test deployment, you will be using a Windows 8 computer to function as the web server. In this exercise, you will install Internet Information Services on your workstation and then configure it to host two websites.…

    • 970 Words
    • 6 Pages
    Good Essays
  • Good Essays

    References: Zacker, C. (2009). Lesson 7: Deploying Web Applications. Windows server 2008 applications infrastructure configuration (70-643) (). Hoboken, NJ: Wiley.…

    • 411 Words
    • 2 Pages
    Good Essays
  • Best Essays

    Open Flow

    • 2946 Words
    • 12 Pages

    [16] N. Handigol, S. Seetharaman, M. Flajslik, N. McKeown, and R. Johari. Plug-n-Serve: Load-balancing web traffic using OpenFlow. ACM SIGCOMM Demo, 2009.…

    • 2946 Words
    • 12 Pages
    Best Essays
  • Good Essays

    Parallel play: from the ages of eighteen months to two years old, children begin to play alongside other children without any interaction. This parallel play provides the toddler with opportunities for role-playing such as dressing up and pretending. It also helps…

    • 525 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Evaluation of Play

    • 688 Words
    • 3 Pages

    Play can be interpreted as, children being given the opportunity to use their imaginative skills, to learn as well as develop their physical, social, emotional and cognitive skills. Play can be child initiated, or adult led, where they provided with resources and support in both situations.…

    • 688 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    role and value of play

    • 1740 Words
    • 7 Pages

    Much has been written on the subject of play and there is visibility in legislation and guidance for professionals:…

    • 1740 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    HTML

    • 745 Words
    • 4 Pages

    A web server is a computer which gives services to other computers connected to the web or World Wide Web. All web pages are stored in the web server. The computer connected to the web, needs special software called web browser. The web browser request to the web server for the information when the web server receives the request, it searches the information within its file system and sends out the request information to the browser through the internet.…

    • 745 Words
    • 4 Pages
    Good Essays

Related Topics