So, to follow up, I have just finished fixing Timothy’s EC2 CS Server.
A few things to note in case others have troubles on AWS or just initial ubuntu setup.
- Be careful where you install the server. Permissions will stop you from building, and you dont want to have to set bad permission practices just to brute force a goal. If you install to /etc ,where things like apache2 and vsftpd, and other servers, you will have to run everything as sudo, including your crontab.
-It may seem like /var/www/html/ChatScript is a good place to put your files up quickly and be able to launch the server and edit the web interface from one place, but this really isn’t the place. I fear I may have thrown you in earlier pastes of my setup showing I was using port 8080. I was only using that because I was testing an SSL ProxyPass. In reality, the chatscript core should be on your file system outside of the web root.
AWS EC2 Setup Break Down
- Launch ubuntu instance (I use 16.04)
- Create a security group opening incoming tcp ports (80,443,1024)
- Create elastic ip. The name is somewhat confusing, but this is basically a static ip. If you dont use one, every time you stop and start your server, or it reboots, you will get a new IP and DNS and private IP and you will have to go change all of your settings. Plus, if you every want to point a (CNAME) at it, youd want this static (elastic ip).
- Update apt-get, install apache2, install php, make sure php mod is enabled with apache2, restart apache2.
-Goto /var/www and set the www-data user/group to own the html folder and its children.
-Add ubuntu to www-data group and set permissions on the files in /var/www/html to allow group control.
-Add a crontab -e to make sure your CS instance persists.
-If using ufw, make sure to open the proper ports.
-Use git to clone the latest version of CS into the location of your preference.
-Set permissions on the files, the docs say you only have to do this on the LinuxChatScript64 file, but I had to do it on the entire ChatScript folder as there are dependencies and files created at start time, and it was failing to create the USERS and LOGS folders due to permissions and halting the server and keeping me from the first build.
Once you spawn your server, you can connect with the client, or just local to the CS server instance in the shell, and do your first build. :build Harry.
To start your CS server correctly on AWS, DO NOT USE localhost, use your instance’s PRIVATE IP ADDRESS.
(e.g ./LinuxChatScript64 interface=172.00.0.000 port=1024) <- 172.00.0.000 being the PRIVATE IP associated to your amazon aws EC2 instance that CS server is running on.
-Put the front end files of your choice from WEBINTERFACES somewhere in your /var/www/html to your liking, edit the php files to point to your PUBLIC EC2 instance or DNS, and set the port CS is listening on, as well as a bot name. If this doesnt work still, it’s likely you have a permission issue where ChatScript and its contents are still owned but root:root and www-data cannot execute the php.
I want to state that I am no linux expert, I have enough knowledge to make things work and get around, and I do strive for best practices, but please note that you must take special care on your own to make sure your system remains secure.
Brian Hodge - Technical Director
Kadho Inc. / Kadho Sports