MyBB Community Forums

Full Version: Scripted/Automated Installation - NOT GUI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

As per the subject line, we need to do a fully scripted installation of myBB (Bash on Linux), this will allow us to spin up the environment in a fully automated fashion. The documented way to setup/config myBB is the navigate to install/index.php and run through the GUI screens. With our particular use case this is not desired, again we need to do this through code. That said, is it possible to do this? If so, how? 


An example of what our current script (bootstrap) process looks like, please note the missing line.

#!/bin/bash

yum update -y
yum install -y httpd24 php56 php56-mysqlnd
service httpd start
chkconfig httpd on

#pull down mybb from S3, extract and move files
aws s3 cp s3://12345-mybb-bucket/mybb_1806.zip .
unzip mybb_1806.zip
mv Upload/* /var/www/html/
rm -rf Upload/ mybb_1806.zip
mv /var/www/inc/config.default.php /var/www/inc/config.php
chmod -R 0777 /var/www/cache /var/www/uploads /var/www/inc/settings.php /var/www/inc/config.php

#complete web server steps
groupadd www
usermod -a -G www ec2-user
chown -R root:www /var/www/
chmod 2775 /var/www/
find /var/www/ -type d -exec sudo chmod 2775 {} +
find /var/www/ -type f -exec sudo chmod 0664 {} +

#start mybb setup steps
cp /var/www/html/inc/config.default.php /var/www/html/inc/config.default.php.bak
mv /var/www/html/inc/config.default.php /var/www/html/inc/config.php
chmod 666 /var/www/html/inc/config.php /var/www/html/inc/settings.php 
chmod 777 /var/www/html/cache/ /var/www/html/cache/themes/ /var/www/html/uploads/ /var/www/html/uploads/avatars/

# execute mybb installation script (bypass gui)
# depends on rds instace being available
#... << this is the info I need, what are the script commands? can I run the install/index.php file from the command line and supply command line arguments/values for each required field??? >>

#post install last step
touch /var/www/html/install/lock



Any information you can share would be greatly appreciated!
The installer cannot be run through CLI since it takes GET- and POST-Parameters, which you cannot send in console. What you could do is using cURL, utilize the response and act based on the response.

Other method is actually create a script which does what the installer does and make it run-able from the console. Or you modify the installer to take cli arguments instead of GET- and POST-Parameters.

But as the installer currently is, it is not runable through the console with PHP CLI.