AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Server mode on justhost web server
 
 

With profound thanks for your ongoing help, a further basic question. I feel I should see this more clearly, but we all start somewhere right?

Trying to deploy a chatbot on a hosted web server. The server runs on port 43. I have adjusted the ui.php accordingly, and provided the correct ip address. I have also uploaded the Chatscript files to the public.html directory in the server.

Is there something I need to do to activate the bot to be running in the server? Or should it work automatically given the right port and IP address? At the moment it finds the port, finds the ip address but doesn’t seem to find the bot. Apologies if this is obvious.

 

 
  [ # 1 ]

I’ll need a bit more information about the host you’re trying to run CS on. Things like hosting provider, OS, whether it’s a shared host, etc. will help me to give the best advice here. Provide what you can, and don’t be afraid to say “I don’t know” with regard to some of the things I’ve mentioned. smile

 

 
  [ # 2 ]

Hello and thanks as always! It is with justhostme.co.uk, with a Linux OS (does that mean I need to NOT specify the port?) - I do believe it is a shared host.

 

 
  [ # 3 ]

Sadly, you’re not likely to be able to host ChatScript on the same server as your website. Places like justhostme aren’t often willing to allow you to put something like ChatScript on their systems for security reasons. My hosting provider (GoDaddy) feels the same way, and for all of their amazing and supportive customer service, they’re just not willing to risk the security of one of their shared server machines for the sake of a single one. Hosting providers won’t generally allow something like that unless you’re paying for an entire server machine (and often not even then), and that gets to be VERY expensive, VERY fast. Even cloud services like AWS or the Google Cloud platform are going to cost a bit of money to run a CS server on their hardware. Another option (and one that carries a few “if’s” would be if your ISP offered enough bandwidth to allow you running CS as a server on your own machine, and if you were able to setup port forwarding from your WAN connection to the hosting computer, and if you were to use a dynamic hostname service, like no-ip or DynDNS to always point a given hostname to your IP address. that’s a lot of technical hoops to jump through, but it’s certainly possible. I’ve done it before with my development server so that I could serve files and websites remotely, but it’s not exactly entry level skill here, and it can be a pain to maintain.

I wish I had better news for you, but there it is. If I recall correctly, someone here may have setup CS on AWS as a standalone server, but I may be misremembering.

 

 
  [ # 4 ]

Actually, I just did a brief bit of creative Googling, and found this:

https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/CLIENTS-AND-SERVERS/ChatScript-Amazon-Server.md

that should help make things at least a little clearer. smile

 

 
  [ # 5 ]

Huh, that’s a downer. I may talk to them directly, if I know exactly what to ask. But their site says they can open some ports, so I would have imagined that technically all I need is that right? Access to a port on their server. Does it have to be an unused port? In other words if they use 80 and 443 does the chatbot need to run on a different port from those? They do from 1025 I believe. But if I had a port open, and their IP address, on a linux shared server, what would I need to do to start serving the client to the universe?

 

 
  [ # 6 ]

Yes, a CS server does need to listen to a different port from http (80/443).

You have two basic deployment options:

A) Have a CS start up in server mode and listening on an unused port, e.g. 1025. If that port is opened to the outside then any-one will be able to connect to that port and communicate if they follow the CS protocol. This is dangerous.

B) Spin up a CS server as before but don’t open the port to the outside world. Instead use a web front end, for example the example shipped with CS, as the view to the outside world and behind the covers it communicates to the CS server on its port. The shipped example uses PHP which has raw sockets support, but you could use anything and have any number of layers between the user and CS.

In our own situation, we have a number of different input channels (web, mobile app, slack, SMS, messenger) that post input to a nodeJS app, which in turn repackages the text and puts it into a message queue which ultimately gets dequeued and sent to a free CS server.

 

 
  [ # 7 ]

Note you can get a free amazon account for a year, hosting CS on that. and more if you have multiple identities. But its only about $20 a month to maintain the server after a year.

 

 
  [ # 8 ]
Andy Heydon - Feb 15, 2018:

B) Spin up a CS server as before but don’t open the port to the outside world. Instead use a web front end, for example the example shipped with CS, as the view to the outside world and behind the covers it communicates to the CS server on its port. The shipped example uses PHP which has raw sockets support, but you could use anything and have any number of layers between the user and CS.

In our own situation, we have a number of different input channels (web, mobile app, slack, SMS, messenger) that post input to a nodeJS app, which in turn repackages the text and puts it into a message queue which ultimately gets dequeued and sent to a free CS server.

 

Super helpful thanks! Your implementation is very much what I am aiming for. I have already created and successfully run a web front-end based on the php template provided for the UI, with a couple of jquery files to interact with the JSON back and forth.  I’d like to move to a full PWA and/or multi-channel bot like yours. Do you happen to have a github repo open for inspiration?

From what you say, as long as I have an unused port open, the php script will activate the bot in the server automatically when people land on the bot page. So in theory, as long as my bot works on LocalServer.Bat I don’t need to do anything in the back end, other than having Chatscript in the public.html directory, next to the ui.php and index.php files. Is that right?

Something like:

public.html
  -CHATSCRIPT_FOLDER
    —-BINARIES
    —-LIVEDATA
    —-RAWDATA
    —-SERVER BATCH FILES
    —-TOPIC
  -SCRIPTS
  -CSS
  -ASSETS
  -ui.php
  -index.php

Is this right?

And thanks Bruce for the headsup re:amazon. Will definitely check it out - you’ve given me a solution if I can’t get my server to work.

Thank you all for your help.  Consider me a new, enthusiastic member of the community - I intend to be working professionally with CS for a long time to come. Your help in climbing the early learning curve is profoundly appreciated.

 

 
  [ # 9 ]

> Do you happen to have a github repo open for inspiration?

We are a commercial entity, so there is nothing public. And I greatly simplified our actual setup!


But if you already have CS running as a local server then you are most of the way there, especially if it is on the same server as your web server. Just have the various php scripts in the web server document tree. Those files can be physically separate from the CS installation as they only communicate with CS via the socket, they don’t reference any files.
If CS is on another port then you’ll have to change the host, but that’s it.

 

 
  login or register to react