I'm looking to map to a directory on a different host using Jetty/Maven when working locally. I've found you can do this w/ Apache using mod_jk (JkMount/JkUnMount), but haven't figured it how to do the same on jetty.
On our dev/q/live servers, we have Apache in front of JBoss and use mod_jk to do this. Locally, we're using jetty
To give you an idea of what I'm talking about, this is how you would configure Apache to accomplish this:
in httpd.conf:
JkMount /images/* host2
JkMount /* host2
JkUnMount /images/* host1
workers.properties:
worker.list=host2,host1
worker.host2.host=host-2.theDomain.com
worker.host2.port=46654
worker.host1.host=host-1.theDomain.com
worker.host1.port=46655
Is there a way to configure Jetty to do the same thing?
Btw, locally, I'm using the Maven plugin for Eclipse if that makes a difference.
thanks!
Update:
I tried going a different route here and just added a folder, then Advanced > Link to a folder in the file system and I pointed to a file on the remote server (I believe we use WebDav). The files show up in project explorer, but they aren't served. I'm going to try setting org.mortbay.util.FileResource.checkAliases to true as specified here:
http://docs.codehaus.org/display/JETTY/How+to+enable+serving+aliased+files
...will let you know if that takes care of it.
Are you using the Spring Framework? If so, another solution here is to use tuckey urlrewrite. You can test for your local domain and only run the rules there.
http://www.tuckey.org/urlrewrite/manual/3.0/introduction.html
Related
I have created a small project using Wt(C++ Web Toolkit). and I now want to host it.
Since there are very sparse resources for this, I read somewhere that LAMP is required for this(since I am using Linux). So after creating an Ubuntu instance at Digital Ocean, I installed my code in it with Apache2, MySql, and PHP. The Apache2 server is working, but it is used for hosting HTML/CSS/JS files. my web page is written entirely in C++.
I got directed to this website: https://www.webtoolkit.eu/wt/doc/reference/html/overview.html#wthttpd where it mentions "connectors" like libwthttp and libwtfcgi. I tried to install them using apt but I get this error: E: Unable to locate package libwtfcgi-dev (same for libwthttp).
The website mentioned above also does not provide clear steps for using these connectors.
I have also looked at other related answers : Host for Wt C++ web framework, deplowment issue but since I am new to web hosting, I would really appreciate a step-by-step guidance.
Even here: https://redmine.webtoolkit.eu/projects/wt/wiki/Fastcgi_on_apache The language is very unclear ast to where fastcgi.conf is located.
This answer assumes that you have the project running locally and just need to 'get it on the web'. You have a few options...
Reverse Proxy
From the tutorial it looks like there is a built in web-server. One option could be to use this, and then setup a reverse proxy (this can be done through Apache) to map traffic from yourwebsite.com to http://localhost:port, where port is whatever you started the web-server with.
The example they give to start the local webserver is:
$ g++ -std=c++14 -o hello hello.cc -lwthttp -lwt
$ ./hello --docroot . --http-address 0.0.0.0 --http-port 9090
here, port would be 9090.
Fast CGI
From the hello world and this thread it seems like a webserver setup with FastCGI may be able to do what you are looking for. Maybe this doc from Digital Ocean can help you get started?
It seems unlikely that you specifically need the full LAMP stack (Linux, Apache, MySQL, PHP) specifically for this. The doc you link does suggest that you need to link against the appropriate library for whichever approach you take, libhttpd or libwtfcgi, and you are correct that apt would be the place to get them on Ubuntu. This is a separate issue, but maybe this answer could be a starting point?
Is LAMP needed?
LAMP is definitely not required by Wt:
Linux is supported, but Windows too.
Apache could be used as a Reverse Proxy, but some alternatives may be even better (f.ex. HAProxy)
MySQL is supported, but also other database backends such as Postgres.
PHP/Perl/Python: not needed in any way.
Reverse proxy
Using a reverse proxy is a great way to deploy your Wt application (see eisaac's answer). If you already use Apache for other websites on your server. It's perfectly ok to use it as a reverse proxy. If you don't need all the features of Apache, using a HAProxy may be the better choice. See also some deployment configuration mentioned in the Wt docs:
https://redmine.emweb.be/projects/wt/wiki/Wt_Deployment
Easiest solution (but not scalable): let Wt directly listen on port 80 (or port 443)
If Wt is the only site running on your Ubuntu instance, you can also make it listen directly on port 80 (or port 443 in case of https):
./hello --docroot . --http-address 0.0.0.0 --http-port 80
See also the different command line options in the Wt doc: https://www.webtoolkit.eu/wt/doc/reference/html/overview.html#config_wthttpd
I am using Grails 2.2 and the plugins are really old. For some reason the dependencies are not resolving. I think it used to work because the plugins and files were in my local cache. From the documentation grails stores the dependencies locally in home/.grails/ivy-cache
With all these declarative dependencies, you may wonder where all the
JARs end up. They have to go somewhere after all. By default Grails
puts them into a directory, called the dependency cache, that resides
on your local file system at user.home/.grails/ivy-cache. You can
change this either via the settings.groovy file:
So the only option i can think of is to go to my remote server and find this directory to copy the dependencies to my local system. So where is this ivy-cache directory in production server? I dont seem to find it. Thanks for any help.
The same issue also I was working in the last week, from 15th January maven had decommissioned the http protocol where the URL "http://repo1.maven.org/maven2/" has changed to"https://repo1.maven.org/maven2/". Also need to check the grails maven to secured.
In BuilConfig.groovy, you can add the dependencies and the changed maven repo else in the _Events.groovy need to change the repo address to secure protocol.
If still you have protocol issue because of JDK8 try this -Dhttps.protocols=TLSv1.2 -Djdk.tls.client.protocols=TLSv1.2 in the path or bat file.
When you build an Ember application the output is placed in the dist folder. Can I take this output and stick it into IIS on a server without installing node? I understand that during development I need to have node.js installed. I'm asking if the production host server will require node.js if I'm hosting in IIS?
A built Ember application (the contents of the /dist folder) is composed of files that can be served statically, so there's no requirement for node.js.
You should be able to serve them with IIS without a problem, just make sure you configure the routes properly if you're using the history API (location: 'auto'/location: history).
I am quite computer-illiterate, but I have managed to utilize the Django framework on my own machine. I have had an account on Amazon Web Service (AWS) for some time, but it appeared rather complex to set-up and to make use of, so I put it of for a while. Then I decided to give it a try, and it was not so hard as I first thought to load a AMI and connect to the server with PuTTY. But since I were already using BitNami's Django-Stack, I decided to take a look at their hosting offer (which builds on AWS). Since they appeared to offer "one-click deployment", I set up a new server through their interface. But then, it seems like the "one-click deployment"-promise is with regard to the server itself. There does not seem to be any interface for deploying Django projects through their site. Having used PuTTY already, and adding WinSCP to my machine, I can acceess the server and load my Django-code unto the server. But then I am lost. The documentation seems a bit thin (look here).
The crux of this is the following: Can anyone make this part of the process more understandable. I.e., how to deploy a Django project on a Linux server with Apache/mod_WSGI?
The other question is: I want to use Postgres. Am I free to install this on the server. Should I opt for EBM (EMB?) for this, or what is the downside of not having EBM?
I hope I am not too unworthy of your attention, thanks!
how to deploy a Django project on a Linux server with Apache/mod_WSGI The Bitnami AMI already comes with all this configured. Once installed try going to the EC2 public url on the default 8000 port and you will see the demo django project setup there. You can add your own project once you have logged into the machine via putty check the /home/bitnami/ directory for the demo project. Copy your project, configure your database The other question is: I want to use Postgres. Am I free to install this on the server Postgres and Mysql are already installed the same way you would do on your local machine. The in your project do ./manage.py runserver 0.0.0.0:9000 since the 8000 port is already running another application.
I am very new to apache and django, so execuse me if this question is simple. I am trying to deploy an existing site to an apache server. For the time being, the site is still in development so I am only deploying it as a virtualhost on my local machine.
I am using Django's WSGI module in the deployment. In my site's config file, I have the following aliases:
Alias /media/ /home/tester/Desktop/siteRootDir/media
Alias /content/ /home/tester/Desktop/siteRootDir/content
WSGIScriptAlias /c /home/tester/Desktop/siteRootDir/deploy/site.wsgi
When I run apache and go to localhost/c I was getting the (13)PermissionDenied error in the apache log. To get around that error, I (admitedly stupidly) ran
chmod -R 777 /home/tester/Desktop/siteRootDir
I know that is not the way to deal with the issue, but I just wanted the site to work so I can continue its development.
So my question is, what are the correct permission settings to the siteRootDir directory and its sub-directories such that the site will run and I do not expose unnecessary files in the directory.
Also, I realize that this is not an ideal set up and I will likely run into problems when I deploy the site in production. Can anyone please suggest a better organizational approach to this?
Thanks!
The tightest permissions possible would be 0600 for files and 0700 for dir's and as a owner the user owning the apache processes. This user differs per OS and flavor (e.g. for OSX it's www, for Debian/Ubuntu it's www-data).
This would probably too tight for a development server. At least would you like to be able to modify all your files through your IDE of text editor, so either you should add ACLs for yourself (i.e. the user that edits the Django files, templates and static files).
Also, in a production server you want the apache user to be able to write to directories that hold web uploaded content. That would be somewhere in your static files section (or on a different dedicated static files server).