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

    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
  • Better Essays

    Unit 8 eCommerce P1

    • 1328 Words
    • 6 Pages

    Web Server: A webserver is a Hardware device used to host an eCommerce website. The server supports the entire content of the website such as HTML files, Data bases and Image Files. Web Servers will run on operating systems such as Windows or Linux and will use web server software to manage access requests to the website. Webservers are similar to PC’s however they have faster processors and more memory making it much more powerful.…

    • 1328 Words
    • 6 Pages
    Better Essays
  • Satisfactory Essays

    Comparing Iis to Apache

    • 392 Words
    • 2 Pages

    Based on my research I would use Apache to implement since it is free and you can use it on multiple platforms. Apache is also more expandable and can be played around with more, unlike IIS.…

    • 392 Words
    • 2 Pages
    Satisfactory 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
  • 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
  • Powerful Essays

    Interpersoanl Skills

    • 1598 Words
    • 7 Pages

    Web Services refers to software modules that have their own URLs and can be called upon to perform their function via the Internet.…

    • 1598 Words
    • 7 Pages
    Powerful 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
  • Best Essays

    Improving System Performance: The Evolution of Concepts Designed to Optimize System Performance Over the Past 25 Years…

    • 2038 Words
    • 6 Pages
    Best 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
  • Satisfactory Essays

     Designed for hosting and deploying web services and applications  Supports multiple processors for scalability  Optimized to run microsoft internet information services specifically  Intended for small to large companies, or departments within an organization that develop and deploy a single web site  Cannot be used to manage directory resources via hosting active directory…

    • 990 Words
    • 4 Pages
    Satisfactory 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
  • 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

    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
  • Satisfactory Essays

    A: yes it would be enough because you would be able to run your own http and or anything you want to install on your computer/server.…

    • 161 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Web services can exchange information between two different systems regardless of the operating system or programming languages on which the systems are based.…

    • 3619 Words
    • 15 Pages
    Satisfactory Essays

Related Topics