loop_1
Posts: 14
Joined: Sat Feb 28, 2015 11:43 am

Two web server on the same RasPi

Sat Feb 28, 2015 11:51 am

Hi! My name is Ale, from Italy.
I'm a beginner in the raspi world but i have two projects:
1- sprinklers_pi
2- Emoncms
can i install both on the same Raspberry?
If i install sprinklers_pi it's all ok... If i install Emoncms it's all ok...
but when i install the sprinklers_pi over the machine with Emoncms, sprinklers_pi start but is not functionally!
I know that there is two problems:
- during the sprinklers_pi over emoncms machine i have an error with sqlite 3 software
- the webserver are on the same port 8080

there is anyone that has resolved this issue? :shock:

Thanks

JF002
Posts: 94
Joined: Sat Feb 04, 2012 8:49 am
Contact: Website

Re: Two web server on the same RasPi

Sat Feb 28, 2015 7:15 pm

You can start as much webservers as you want (as long as there are enough ressources to make them run), BUT, they cannot run on the same port.
In your case, you can start the first one on the port 8080, and the second one on the port 8081, for example.

I don't know any thing about the 2 applications you are trying to install, but you'll have to configure one of them on another port.
My web site : https://codingfield.com

loop_1
Posts: 14
Joined: Sat Feb 28, 2015 11:43 am

Re: Two web server on the same RasPi

Sun Mar 01, 2015 7:01 pm

yes, i need to change the port but i think that there is also a sql conflict...

cil8
Posts: 179
Joined: Tue Feb 14, 2012 10:47 am

Re: Two web server on the same RasPi

Tue Mar 03, 2015 1:27 pm

You can't put two services on the same port.

You can install Nginx and use its reverse-proxy feature: it binds to port 80 (or 8080, if you prefer) and then it routes the incoming requests to one of the other two services that are listening on different port numbers. Obviously, you have to provide Nginx some kind of rule to choose the destination service of each request.
search for 'nginx reverse proxy'.

hth.

ciao

loop_1
Posts: 14
Joined: Sat Feb 28, 2015 11:43 am

Re: Two web server on the same RasPi

Tue Mar 03, 2015 4:25 pm

Thanks! now i try this!

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Two web server on the same RasPi

Tue Mar 03, 2015 11:14 pm

You can use virtual hosts to serve multiple sites without having multiple ports.

Return to “Networking and servers”