Node.js + Socket IO + Apache + PHP cheap webservers? [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am new to using node.js and socket io and I am currently hosting my php website on a server, now that I am going to be adding node js and socket io to my website I will need hosting that will allow me to have those, are there any out there or will I need to have my own? I am hoping to have a cheap hosting service as this is just to have my site hosted while in development, once I am finished with it I plan to have my own server set up.

I recommend DMEHosting as a VPS to use for development. Their cheapest Linux VPS is more than affordable and serves your purposes. It will also get you into the basics of setting up a web server on Linux via SSH, which is essential. I recommend reading up on an article on setting on a VPS on Cent OS. Just Google that. You don't really need to learn how to use Linux for now. Just know how to navigate directories and follow tutorials on setting up your own web server.
Edit: Keeping this post as is for historical purposes, but I now recommend an EC2 instance or DigitalOcean.

Here is a list of Node hosting solutions. However, if you want to be able to have Node.js + PHP and Apache, you will need to use your own server, like a VPS. Popular options are Linode, Slicehost, Amazon EC2 and Fanatical. Note that the VPS option will require good knowledge of Linux.

Related

Running node, PHP and Python on the same vps [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Is there a rational way to serve multiple websites via PHP:Nginx, Python:??? & node.js on the same vps?
And would it be reliable?
The sites are expected to be low in traffic.
I currently have PHP running on Nginx, Ubuntu via Digital Ocean and I would like to stick to Nginx for PHP and any major webserver for Python.
The kind of setup you're describing is straightforward and not complicated. Nginx works fine as a reverse proxy and web server that handles serving static assets.
For PHP, you just need to proxy to php-fpm (running on a TCP port or unix socket).
For Python, you need a wsgi server (something like uwsgi or gunicorn, again using a TCP port or unix socket) to server the Python app and have Ngix proxy to requests to it.
For your Node.js app, just run the node server on a port like 8000 and have Nginx proxy requests to it.
If you have a bunch of websites, each should have a server block matching a unique server name (i.e. mapped to a virtual host).
The setup is as reliable as your backend services (like php-fpm, wsgi, and Node.js server). As long as those services are up and running (as daemon services) nginx should have no problem proxying to them. I have used all 3 setups on one server and have never experienced problems with any of the above.

PHP Websocket server in Linux hosting [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a GoDaddy Linux hosting , any idea how do I run a websocket server for my HTML5 web app ? Any other recommendation ?
I know VPS can do it, but it is costly , any PaaS solution ?
If you have a shared hosting plan, you will very likely not be able to access sockets, thus making it impossible to use the WebSocket API.
You're going to need a virtual private server for this one.
If you got that set up you can take a look at socket.io and node.js which does exactly what you're looking for. There are a couple of examples of how to set it up on their websites plus you can take a look at this blog post which has some examples on how to set up node.js and socket.io with html5's canvas and websockets to have some realtime drawing going on.
Edit: Theres a second option of running a php based socket server, although not as good as the option above, but it can probably(?) be done without vps.
PHP has seme basic functions to create a socket server that are listed here. There are a couple of examples of how to set it up such this. And theres also this stackoverflow answer here that lists a couple of google code projects that does exactly what you need such as this.
The best PHP WebSocket self-hosted/install solution right now is Ratchet.
However, as stated by #HartleySan, you're unlikely to be allowed to use a WebSocket solution on a shared plan due to the requirement for persistent connections. This is especially the case with general PHP solutions that allocate a large amount of resource to each request. Ratchet may have worked around this, I don't know.
IMHO the best solution for PHP is to use a hosted service such as Pusher, who I work for. There are other realtime web hosted solutions available too. This means you offload the persistent connections to the hosted service and can use your PHP stack in the normal way.
Also related: OpenShift, a PaaS, have written an article which covers the challenges of WebSockets. This helps explain the problems that other hosting providers are having when supporting WebSockets.
OpenShift do have WebSocket support in preview so you could try them out. But that is obviously a problem if you've already paid for your shared hosting. As above, I'd recommend a hosted service as the best solution.

Node.js + PHP + MySQL VPS hosting [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a website that I am building that is coded in PHP and I use MySQL for the database, I am also using node.js for most everything, so my website cannot exist without it for the most part.
I have been with a small company (One that a friend of mine started up) and they have given me cheap VPS hosting, and they even setup everything on the server that I needed done (because I have no clue how to set up a server myself) I currently pay $15 per month for hosting, and would not want to pay anymore than that at this time. (As my website is still in development, so it's just for my own personal usage and sharing among some friends for testing and such).
I need a relatively cheap hosting provider that gives me basically 100% control of the server (as I have many needs that usually are not part of packages), and I would also like to be able to have them (or someone) set up the server for me.
why not just sign up amazon ec2 free for one year Here

understanding vps v shared hosting [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I currently deploy my sites on shared hosting, it's cheap and has control panels and help etc.
I've been looking at a VPS server and understand I will have full control etc etc.
Is it easy to make a switch to VPS - do I need to install everything from scratch eg mysql, php, control panel etc. I'm a bit worried about that sort of thing.
ONe of my main reasons for changing is that I want to dip into zend and other frameworks. ON my current shared host (hostpapa) I can change the php.ini settings. Is VPS a step to far?
My sites are not over intensive
Ta
If it's a managed VPS then you don't have to worry about the installation, but if it is unmanaged then you would have to worry on alot of thing, not only security but also optimization. If you're not consuming the whole b/w of your account and you don't really that much of freedom then you sure can stay in your shared host.

Can you run Ruby and Rails and PHP together on the same site? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Why? Because for our site I want to develop a Rails application, but I also want a separate part of it (perhaps the public directory) to be easy to modify by a PHP programmer/web designer.
Is it possible to run both on the same site? Are there any reasons why it is not a good idea or not a best practice?
I am pretty sure Nginx and Lighttpd can do it. For example, you can run php worker processes with php-fpm and configure the webserver to send any php jobs to them. Every other job could be configured for rails. I have never tried it myself.
You can use the vhost, port, or file extension (*.php) to determine where the webserver will send the request.
I think it would be an ok idea if lets say you have a PHP site but want to have a non-blocking application in nodeJS or use Tornado and have Nginx configured to proxy requests to them.
Example where Nginx is used for PHP-FPM and Node.js
http://blog.mixu.net/2011/01/04/nginx-php-fpm-and-node-js-install-on-centos-5-5/
In this example Node is ran on port 8000

Categories