Skip to content

Instantly share code, notes, and snippets.

@defulmere
Last active September 6, 2021 23:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defulmere/df5251e419b22cfd5e47a1ef3d9f3917 to your computer and use it in GitHub Desktop.
Save defulmere/df5251e419b22cfd5e47a1ef3d9f3917 to your computer and use it in GitHub Desktop.
drupal and open social on opalstack
  1. Create a new MariaDB database and user at https://my.opalstack.com/mariadb/ and make a note of the database name, database user name, and database user password.

  2. Create a new shell user at https://my.opalstack.com/apps/.

  3. SSH to the new shell user and run the following commands:

    cd ~
    # install composer
    mkdir -p ~/bin
    wget -O composer-setup.php https://getcomposer.org/installer
    php74 composer-setup.php --install-dir=$HOME/bin --filename=composer
    rm composer-setup.php
    
    # install opensocial, replace `SITENAME` below with your own. 
    # This will be the directory that holds the entire installation.
    php74 ~/bin/composer create-project goalgorilla/social_template:dev-master \
        $HOME/SITENAME --no-interaction
    
    # install drush and set up drupal, replace SITENAME, DBNAME, DBUSER, and DBPASS with your own.
    cd ~/SITENAME
    export PHP_INI_SCAN_DIR=/etc/opt/remi/php74/php.d:$PWD
    export DRUSH_PHP=/bin/php74
    echo "memory_limit = 256m" >> .user.ini
    php74 ~/bin/composer require drush/drush
    ./vendor/bin/drush -y site-install social --db-url mysql://DBUSER:DBPASS@127.0.0.1:3306/DBNAME
    

    You'll see an error message about sending an email when the final command completes. Ignore the error and make a note of the admin credentials in the final line of output.

  4. Back in the dashboard, go to https://my.opalstack.com/apps/ and make a new app with the following values:

    • Name: SITENAME_html
    • Type: PHP Apache Symlink
    • Shell user: your shell user from step 2 above.
    • Symbolic link path: /home/SHELLUSER/SITENAME/html/ (replace uppercase values with your own)
  5. Go to https://my.opalstack.com/domains/, add your domain there, and then create a new site to serve the app from step 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment