Skip to content

Instantly share code, notes, and snippets.

@murtaugh
Last active October 27, 2021 03:33
Show Gist options
  • Save murtaugh/944a6c5043202e045555 to your computer and use it in GitHub Desktop.
Save murtaugh/944a6c5043202e045555 to your computer and use it in GitHub Desktop.
Set up a DigitalOcean droplet for ExpressionEngine

(This is an updated version of Clearfire's tutorial, which is excellent, but has become slightly outdated as Digital Ocean updates their applications.)

  1. Create your droplet. Name it, select your size and location, then hit the Applications tab and select (as of this writing) "LAMP on 14.04". Add your SSH key if you want, and submit.

  2. SSH into your new droplet, and maybe check to make sure the following PHP modules have been installed: (In my recent experience, these have all been installed automatically, but that could change, and it takes 10 seconds to check.)

    apt-get install php5-gd

    apt-get install php5-mysql

    apt-get install php5-curl

  3. Make sure mod_rewrite is enabled, with a2enmod rewrite.

  4. If you like, increase PHP's upload_max_filesize and post_max_filesize values by editing the php.ini file, with this: nano /etc/php5/apache2/php.ini

  5. Give Apache a restart: service apache2 restart

  6. Change the MySQL root password: mysqladmin -u root -p'[FOO]' password newpassword (The initial password is displayed in the terminal when you first SSH into the new server. Look for "Your MySQL root user's password is [FOO]".)

  7. Log in to MySQL: mysql -u root -p (It will prompt you for your new password.) Note: Sometimes this fails, and you need to manually reset the root password. These instructions have worked.

  8. Create a new user, so we aren't using root all the time: CREATE USER [NEW USERNAME]@'%' IDENTIFIED BY '[NEW PASSWORD]';

  9. Grant the new user full access: GRANT ALL PRIVILEGES ON * . * TO '[NEW USERNAME]'@'%';

  10. FLUSH PRIVILEGES; and exit out of MySQL.

  11. If you want to allow remote connections (and during development, I certainly do), edit the MySQL config file: /etc/mysql/my.cnf, commenting out the line bind-address 127.0.0.1.

  12. Restart MySQL: service mysql restart

  13. Make sure .htaccess is enabled for rewrites. Edit this Apache config file: sudo nano /etc/apache2/sites-available/000-default.conf (In my limited experience, this file name is subject to change as new versions of Ubuntu are realeased, so if Nano opens an empty file, that ain't it.)

  14. Add this directory statement:

    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    
  15. Voila! Your web root is at /var/www.

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