Basic knowledge for Node.JS? - php

I'm trying to learn about node.js and there are tons of examples out there, but one question that I can't find an answer to or example is how does this work with web hosts (i'm using inmotionhosting.com)?
say I have a basic website www.url.com/index.php (note: I'm using PHP also). For this website to work, all I have to do is upload a file into my file manager in my web hosting site.
How does node.js work? do I just upload a node.js file into the web hosting also?
In all the examples, they are using localhost with port 8000 or something. Can someone shine some light?
Thanks!

you will need at least VPS hosting to install node.js, shared hosting won't allow you to install any application on your own, unless you they give you the option to do it.
then it all depends on how you have configured and what application is node.js serving, you can't really say where to upload files by default unless a path is set either from you or from webhosting..
from nodejs.org
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
it doesn't say it specific for web use, instead you should use a web framework such as
ExpressJS where you can build you web application or any other stuff.. your host should provide further information on how to manage packages in your nodejs instance, configuration, etc..
some usefull links
Domain API
ExpressJS
ExpressJS examples

Here is something i came cross.
Hosting your node app?
Hosting Node Apps
nodeFu
Supported hosting providers?
Node Hosting
just read the descriptions for each section.

Related

Serving HTML application when offline

I am writing an application to use even when offline. I tried the HTML5 manifest(which is now deprecated) and also opted to use 'Service Workers' but my application is a local intranet web page which cannot be served as HTTPS currently due to restrictions.
Can you advice me on how I can architect the webpage? I am hosting the application on IIS and it needs to be used on mobile devices when both offline and online. I am using PHP for backend
Would appreciate some guidance on this. I went through some of the previous answers and tried them but none fits my requirements. Is there any other way I can make the application served offline?
So, we resolved to lifting restrictions on the server to allow https connections locally on our network. This fixed my requirement

creating a real time application in laravel without nodejs

I am using a shared hosting in which i can't use node js.
But I want to create a real time application using laravel as per there https://laravel.com/docs/5.3/broadcasting doc they provide drivers they all uses node if I am not wrong.
I have also searched about https://github.com/Askedio/laravel-ratchet which works with laravel but it requires a ZMQ which I can't install on my shared hosting.
What should I do any ideas.
You could use Pusher and combine it with Laravel Echo. Echo is a front-end JS framework, so just include the assets and you should be fine.
I think it should be said that it's probably not a good idea to develop these kinds of apps on shared hosted servers, due to a couple of reasons:
You almost never have SSH access, so deploying and debugging is an immense pain
You can't install additional software you need, like NodeJS
Shared hosted servers often aren't build to run heavy php applications, they are build to serve simple websites (that's why they're so cheap)
Depending on your host, all other ports than 80 and 443 are closed, so usage of external services can be blocked
All in all, I think it's better to just get a cheap VPS (i.e. a DigitalOcean $10 plan) in which you can actually do all those things. Yes it's more expensive than shared hosting, but if that's really the game-changer, find a sponsor or partner. $120 is a piece of cake compared to the pains of using shared hosting, and that's speaking out of experience.

Is there a way to host Axis2 service within PHP/WordPress?

I am new to web services and I am learning to create web service on Axis 2 framework. I created a couple of simple (HelloWorld type) web services. I want to host these services on my Hostgator account, currently having a wordpress installation on it. I am not able to find a link between Php based framework and Axis 2. Is there a way to do that?
P.S: I dont want to write SOAP based web service in PHP yet.
Look, as you have found yourself, hosting an HTTP server (with HTML/PHP,JS files and a PHP interpreter engine) is different from hosting a Java web application (like your web services). You need a different hosting solution where you can deploy a web container/web server with your Web services application and there's no way your current hosting alone will do the trick.

NodeJS and PHP hosting

I am using nodejs and php on my website but when I want to host it on a server they told me there is no server that can run both node and php.
Is there anything that could take the place of nodejs and do the same work not requiring a server for it? I am using nodejs and socket to make realtime updates for my website .
A couple of options are DigitalOcean, AWS (Amazon Webservices) and Heroku.
Personally, I'd go with DigitalOcean. IMO it's the best for small projects; user friendly (good for beginners as well as advanced users), neat stability, easy scalability and best of all: insanely affordable. You can run both in one 'droplet' as you have full control over the OS.
You can do it at A2 Hosting
This allows Apache to act as a Proxy to the Node aplication,
A2 How to install and configure Node.js on managed hosting accounts

Bypass tcp/ip communication to service located on same server

I'm working on a project that is located on 2 domains within same server:
1. DataSource system, which provides data for main app
2. Main app, providing the data for front-end app.
App 1 needs to work on seperate domain, as it's data source for more applications. I'm trying to find some way to boost communication performance. Simple call from app 2 to app 1 takes approximately 0.3-0.4s.
Is there anyway to force server to bypass TCP/IP communication and call service directly from localhost?
Both applications are written in PHP with Zend Framework. The server is IIS. Both applications are based on SOAP solutions.
Would appreciate any tips. Will provide additional information if needed.
Thank you in advance for any help.
You have a misunderstanding here. If you call services from localhost (i.e. via Zend_HTTP_Client), this means you are using the tcp/ip and http layers here. Everything works via sockets, no matter if localhost or external ip address.
If the other application needs to be accessible "from the outside" (no integration possible) you can imho only speed up by using a faster webserver (e.g. nginx), turning off modules in your webserver that you don't need or writing your own socket server, dismissing a whole lot of the processing apache and nginx do. http://devzone.zend.com/209/writing-socket-servers-in-php may help you with your first steps.

Categories