简体   繁体   中英

How to deploy a Play Framework Site to an Apache based domain

I have tested Play now for quite a while and everything is set up locally. Now I came to the next level:

  • I need to deploy may test project to an exisiting domain. I have searched the web and tried several things, but none of them helped me deploy my web application.

Let's say that I am a n00b, and I am. I registered myself a domain via www.antagonist.nl. My domain is wwww.tus***.eu. I have no right to change anything on their 'server', I guess.

But how can I deploy a Play Framework Application\\Website on such a domain??

Thanks all for helping out.

Hm. What you registered is a domain with webhosting for PHP/Mysql web sites. What you are looking for is a Play! hosting service. You cannot deploy a Java solution to a PHP Server.

You will have to host your play application on one of those services and then redirect your domain via DNS redirection toward the platform hosting your app. The DNS modification should be possible via your registar (antagonist.nl) but that procedure is specific for each registrat so I can't help you.

By the way, here are a few Play! hosters :

If you have access ( ssh access ) to the server ( apache, httpd ) where you intend to deploy to, then once you register your domain say using Godaddy, have the A (host) to point to the IP of the hosting server ( where your application is runnnig )

host = @
ip = "the ip of the hosting server"

In the server you will need to navigate to the file /etc/httpd/conf/sites-available/
or the equivalent in apache2
and change the file corresponding to your site to this type of file. save the file.

<VirtualHost *:80> 
ProxyPreserveHost On
ProxyRequests Off
ServerName www.yourdomain.com
ServerAlias yourdomain.com
ProxyPass / http://localhost:9000/
ProxyPassReverse / http://localhost:9000/
</VirtualHost> 

And then restart the server, your application should run just fine. Later you can have other applications running on other ports, just do the same and change the corresponding fields, with port numbers also changed.

These guys are doing the same for other applications that are running on other ports but 80 StackOverflow answer : Apache redirect to another port

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM