rooftopcms / rooftop-cms

Rooftop CMS is an API-first WordPress CMS for developers and content creators
http://www.rooftopcms.com
GNU General Public License v3.0
220 stars 23 forks source link

VPS Deployment #28

Closed hhsnopek closed 7 years ago

hhsnopek commented 8 years ago

Hey guys I just got rooftop-cms to work on a droplet. Here's the run down on how to set it up and some issues I'm still having.

Issues

Assumptions:

OS: ubuntu 14.04

Dependencies:

One Liner:
apt-get install -q -y curl php5-cli php5 php5-mysql git mysql-server nginx php5-fpm php5-curl redis-server

List:
- curl
- php5-cli
- php5-mysql
- php5-fpm
- php5-curl
- redis-server
- mysql-server
- nginx
- git

Modified vvv-init.sh:

echo "Starting Rooftop"
echo "----------------"
echo "Starting mysql"
nohup /usr/bin/mysqld_safe 2>&1 &
service mysql start
sleep 5
mysqladmin -u root --password 'root'

echo "Starting redis"
nohup redis-server &

echo "Configuring hosted wordpress CMS"
cd /web
composer install

echo "Creating database (if it's not already there)"
mysql -u root -e "CREATE DATABASE IF NOT EXISTS $DB_NAME"
mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER@'$DB_HOST' IDENTIFIED BY '$DB_PASSWORD';"

echo "Installing Wordpress Core"
wp core multisite-install --subdomains --url=${WP_URL} --title="Hosted Wordpress" --admin_user=${WP_ADMIN_EMAIL} --admin_password=${WP_ADMIN_PASSWORD} --admin_email=${WP_ADMIN_EMAIL} --allow-root --path=web/wp

echo "Starting php5-fpm & nginx"
service php5-fpm start
service nginx start

This is the modified requirements to public/composer.json, this is required as a couple deps aren't OSS by the rooftop team currently.

  "require": {
    "php": ">=5.4",
    "composer/installers": "~1.0.12",
    "vlucas/phpdotenv": "^2.0.1",
    "johnpbloch/wordpress": "~4.4.0",
    "wpackagist-plugin/rest-api": "2.0-beta9",
    "rooftopcms/rooftop-preview-mode": "dev-development",
    "rooftopcms/rooftop-api-authentication": "dev-development",
    "rooftopcms/rooftop-admin-theme": "dev-development",
    "rooftopcms/rooftop-response-sanitiser": "dev-development",
    "rooftopcms/rooftop-gravityforms-exposer": "dev-development",
    "rooftopcms/rooftop-webhooks-admin": "dev-development",
    "rooftopcms/rooftop-acf-exposer": "dev-development",
    "rooftopcms/rooftop-content-hierarchy": "dev-development",
    "rooftopcms/rooftop-content-fields": "dev-development",
    "rooftopcms/rooftop-custom-content-setup": "dev-development",
    "rooftopcms/rooftop-content-settings": "dev-development",
    "rooftopcms/rooftop-response-headers": "dev-development",
    "rooftopcms/rooftop-queue-pusher": "dev-development",
    "rooftopcms/rooftop-s3-upload-setup": "dev-development",
    "wpackagist-plugin/amazon-web-services": "0.3.4",
    "wpackagist-plugin/wp-api-menus": "1.2.0",
    "predis/predis": "~1.0.3",
    "icanboogie/inflector": "1.3.3",
    "wp-cli/wp-cli" : "~0.22",
    "psy/psysh" : "~0.6"
  }
hhsnopek commented 8 years ago

Figured out why I couldn't create api keys, the table wasn't created... just add this line to the bottom of all the mysql lines for a work around:

mysql -u root -e "USE $DB_NAME; CREATE TABLE ${DB_PREFIX}api_keys ( id MEDIUMINT NOT NULL AUTO_INCREMENT, key_name VARCHAR(256) NOT NULL, domain VARCHAR(256) NOT NULL, api_key VARCHAR(256) NOT NULL, user_id INTEGER NOT NULL, PRIMARY KEY(id), INDEX(domain), INDEX(api_key))"
hhsnopek commented 8 years ago

I'm not sure if this is suppose to be possible, but I'm unable to create new websites as well... I'll investigate this as well

edtjones commented 8 years ago

Crikey that's pretty intrinsic. Well done on the legwork here @hhsnopek.

hhsnopek commented 8 years ago

Correction, I am able to create new sites within the instance, I had an incorrect alias locally pointing to the server. All is good now, I'll keep an eye out for any other issues 😄