• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux DevAAC on Ubuntu Trusty 14.04 64 bit

Michael Orsino

Premium User
Premium User
Support Team
Joined
Nov 15, 2007
Messages
854
Solutions
10
Reaction score
389
Location
Santiago, Chile (Australian)
Hi guys,

I'm trying to get DevAAC working on my Amazon EC2 instance running Ubuntu Trusty 14.04 64 bit
Currently the DevAAC homepage is accessible via the global IP address but the configuration is not working.
This is a fresh instance and I have documented the steps as I have taken them

Any help would be greatly appreciated

Thanks,
Michael

-- instance launched -> security set to allow all inbound & all outbound traffic
-- sudo apt-get update
-- TFS 1.x dependencies installed
Code:
sudo apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev
-- TFS 1.x cloned & installed
Code:
git clone https://github.com/otland/forgottenserver.git
cd forgottenserver
mkdir build && cd build
cmake ..
-- apache2, mysql server, mysql client, phpmyadmin installed
Code:
sudo apt-get install apache2 mysql-server mysql-client phpmyadmin
-- apache2 webroot changed per DevAAC requirements
Code:
changed to /var/www/public_html/ (changed in /etc/apache2/sites-availabe/000-default.conf)
-- DevAAC downloaded and placed in /var/www/ (DevAAC's public_html is now in position)
-- DevAAC config file renamed to config.php, TFS ROOT uncommented and set to correct location:
Code:
define('TFS_ROOT', '/home/ubuntu/forgottenserver');
-- /home/ubuntu/forgottenserver/config.lua all comments removed, global IP set, database configuration set
-- mysql database created & schema.sql imported successfully
-- apache restarted successfully with sudo service apache2 restart
-- DevAAC homepage is reachable via global IP address, but the configuration is not working
-- mod_rewrite applied with sudo a2enmod rewrite & apache restarted again
-- Still not working as intended
 
open_basedir is present but has no value in /etc/php5/apache2/php.ini

I've done some reading and I believe the issue lies in apache2.2 security policy breaking backwards compatibility with some web applications.
If you are familiar with using private keys with SSH I welcome you to connect and take a look at the configuration, there is no sensitive data on the instance.
 
Last edited:
I suggest you configure PHP as FPM, not as mod_php for Apache. You can also follow any tutorial to set up nginx + PHP5-FPM, that's how I always do it.
 
Alrighty, I gave nginx + php5-fpm a go on a fresh instance
The end result is the same for me
I'm going to try running your Ubuntu setup script now on a fresh instance and check the results

Breakdown of steps taken to install nginx+php5-fpm on a fresh instance
Code:
- sudo apt-get update
- sudo apt-get install mysql-server mysql-client
- sudo update-rc.d -f apache2 remove (I did this to ensure that apache2 hadnt shipped with the instance)
- sudo apt-get remove apache2
- sudo apt-get install nginx
- sudo service nginx start
[nginx confirmed running @ global IP]
- sudo apt-get install php5-fpm
- sudo vim /etc/nginx/sites-available/default
[confirmed listen's are set, changed document root as required to /usr/share/nginx/public_html/ uncommented the php section {}]
- sudo service nginx reload
- sudo vim /etc/php5/fpm/php.ini
:/cgi.fix_pathinfo --> uncommented this line, changed value to 0
- sudo service php5-fpm reload (discovered ubuntu/nginx issue. must reload by killing & starting)
- sudo pkill php5-fpm; sudo service php5-fpm start
- info.php file created in document root http://54.66.131.68/info.php
- sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-mysqlnd
- sudo apt-get install php-apc
- sudo pkill php5-fpm; sudo service php5-fpm start
- TFS 1.x cloned & compiled
- phpmyadmin installed & linked to nginx (detailed below)
- sudo apt-get install phpmyadmin
- sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/public_html
- sudo pkill php5-fpm; sudo service php5-fpm start
- database added to mysql & schema imported
- DevAAC downloaded & put into position such that public_html was /usr/share/nginx/public_html/
- DevAAC config.php renamed as required and TFS_ROOT uncommented and location set as required
- TFS config.lua edited to remove all comments & set database info

DevAAC page will load but config is not working as intended
For reference, I also tried moving config.lua into the web root & changed the config.php to suit - no luck
http://54.66.131.68/index.html#/
http://54.66.131.68/info.php

Results of using your all in one script on a fresh instance:
Script fails at:
Code:
TASK: [Check hostname] ********************************************************
failed: [localhost] => {"changed": true, "cmd": ["hostname", "-f"], "delta": "0:                                                                                                                                                             00:00.003584", "end": "2015-06-22 11:08:38.948759", "rc": 1, "start": "2015-06-2                                                                                                                                                             2 11:08:38.945175"}
stderr: hostname: Name or service not known

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/local.retry

localhost                  : ok=20   changed=18   unreachable=0    failed=1

I'm not going to spend any more time on this myself as I am happy to continue developing in windows, my feeling about it is that it should be able to run on the basic apache2+mysql deploy I originally tried though without too much screwing around (or at least something needs to be documented)

Thanks for your help in any case
Michael
 
Last edited:
I changed the hostname from the default (in this case "ip-172-30-0-28") to the global IP address using the hostname command
I haven't touched the /etc/hosts or /etc/hostname file manually at this stage

Following some of your previous instructions in the release thread I ran..
rm -rf /srv/otshosting-provisioning
I then repulled, dropping the -o flag
Code:
PLAY RECAP ********************************************************************
localhost                  : ok=62   changed=42   unreachable=0    failed=0
I guess the script relies on the fully qualified domain name at that point

After the script completed I removed all the config.lua comments and sure enough the website works correctly.
One thing that you might be interested to know though, if I change the database name from 'forgottenserver' to 'forgotten' (an additional database I have created and populated) the website configuration no longer works.
I will test if THAT was the problem all along in the apache+mysql instance and the nginx+php5-fpm instance


Update:
Couldn't get nginx deploy working
Couldn't get apache2 deploy working
 
Last edited:
Back
Top