Do I need to run both nginx and jetty on the server machine? - nginx

I've set up nginx in a laptop running ubuntu and I will be using this machine as the server.
But I am programming with Clojure on an OS X laptop and I installed Jetty on OS X. I compiled the .war file on the OS X and run Jetty server on the OS X.
Now I realize that this is probably wrong. Should Jetty be also running on the ubuntu server? Can you explain the correct way to work with this set up?

No, you don't need to have both servers on one machine. Nginx can forward requests to other server by ip
upstream jetty {
server 192.168.1.33:3000;
}
You need to be sure port is opened and accessible (not firewalled) from nginx machine.
> telnet 192.168.1.33 3000
Both nginx and jetty should run on server, on dev running just jetty is fine unless you test "like-production" environment (for example nginx websockets support).

Related

LetsEncrypt Install on a Raspberry Pi web server

I've created a web server on my Raspberry Pi 4 and using it for a web project that I'm currently working on as well as future website projects. Currently, I'm running on Pop OS Linux distro on my main laptop and SSH to the Raspberry Pi running as a web server. I'd like to install the letsencrypt SSL on the webserver. I've found some tutorials on a Google search and have had no luck with the installation of certbot. I'm currently running the Nginx web server on the Raspberry Pi.
I have changed some of the settings on the /etc/Nginx/sites-available & sites-enabled and still no luck with the SSL running on the webserver. Are there any other suggestions or tips that anyone can throw my way to get this web server installed with a secure socket layer of encryption? I'm currently running the web server on my Raspberry Pi's IP Address. Maybe I need to change it to an actual domain name beforehand and see if that works?
When I run:
sudo systemctl status nginx
It returns as active. Which is good. Any suggestions?
You should go for following the steps, serially:
You need to register a domain name with a official DNS (Domain Name System) Register, e.g. NameCheap, Google Domains, Go Daddy.
Install certbot following instructions on Let's Encrypt tutorials all SSL/TLS certificates will be installed automatically, (assuming that you're not requesting a wildcard certificate, I too recommend not doing so as it's a hassle in getting a wildcard certificate).
Make sure all ports are correctly forwarded to the Raspberry Pi and that there is no firewall interfering with the ports 443 and 80 and make sure that your ISP is not blocking them whatsoever, since Let's Encrypt needs to verify that your domain name and website exists and is accessible.

Not able to access nginx from outside world

Not able to access nginx from outside the server
I have used ansible role written by me to download nginx on linux machines. But i'm not bale to access that nginx service outside of the server (the one on which it is installed)
https://github.com/kishanagarwal/ansible_poc/tree/master/roles/nginx
You can access the code from above url
I am able to get a welcome page of nginx service running on Centos machines, but can't get anything when i tried to access ip address of machine running on ubuntu 14.04 and having nginx installed on it.
Its simply means nginx port is not opened.
steps to follows:
login to your machine which is trying to access nginx.
if it is windows ,open DOS prompt OR if it is linux, open terminal.
run following command :
telnet
Based on output , if port is not open, you can refer following guide to open port:
https://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/

Change velocity-mirror host from localhost to specific one in client

I am in a window 7 and meteor project is under ubuntu server on VirtualBox. So when I install velocity, I've got a problem with localhost in my windows browser.
http://localhost:5000/?mocha=true&lastModified=1424259562250
net::ERR_CONNECTION_REFUSED
I want to change localhost to my ubuntu server VirtualBox IP.
You need to set your ROOT_URL environment variable. This is also true for running the app on a mobile device with Cordova. I found that if my main (not unit-testing) Meteor app was serving up from 192.168.0.222:3000 that my ROOT_URL variable should look like this:
ROOT_URL="http://192.168.0.222:3000"
I'm using sanjo:jasmine with velocity and with that I can tell you that it uses different ports for client and server unit test servers and that the 3000 in the ROOT_URL variable will get changed to the appropriate ports but it will use the 192.168.0.222 host IP.

Why can't I make an http request to the ASP.NET development server on localhost?

I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:\Users\farmercs>telnet localhost 54752
Connecting To localhost...Could not open connection to the host, on port 54752:
Connect failed
I can see in the system tray that the server thinks it's running, and a netstat -a -n command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752) but with the same result.
So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
have you checked your host file?
%SystemRoot%\windows\system32\drivers\etc\host
look if there is any redirection of localhost or 127.0.0.1 to somewhere else rather than your pc

Accessing asp. net development server external to VM

Guys, been knocking my head against the desk (instead of the mac) for hours. I'm running VS 2008 in a parallels VM. I can access the development server in the VM if local host is used, if I use the designated ip for the VM or try to access it externally it does not work. All firewalls are off and I verified that I can access iis externally.
Any Ideas what could be wrong?
I ran into this same problem and am using a TCP tunnel to bypass it. Download this Java app & just tunnel the traffic back. No messing with IIS necessary!
http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml
In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...
java -jar tunnel.jar 80 localhost 1088
Yes, it is by design. Consider using IIS instead.
The first answer is that you can't do it because the development server is specifically made to just run locally, otherwise it becomes a security risk.
The second answer is that you can get around anything, this hints that there is a way to do it using a reverse-proxy (but the post he links to seems to be dead)
EDIT : After viewing RichardOD's answer, I fear that my answer below is wrong and you can not access it using IP.
But I suggest you to go with deploying it to IIS.
The VS2008 internal web server ( which I guess is cassini ) creates a port for your app and runs a web server for your app on that port. If you want to access it from outside the machine you have to use that port in addition to IP.

Resources