Skip to content

Instantly share code, notes, and snippets.

@waylay
Last active February 15, 2017 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waylay/8fd0c7280cfe1546638598add083d0c4 to your computer and use it in GitHub Desktop.
Save waylay/8fd0c7280cfe1546638598add083d0c4 to your computer and use it in GitHub Desktop.
Add new domain or subdomain on DO
1. Networking / Add Domain or Create new A record for subdomain;
2. cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
3. vi /etc/apache2/sites-available/example.com.conf
-----------
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/example.com
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/example.com/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Include /etc/phpmyadmin/apache.conf
------------
4. mkdir /var/www/example.com
5. chown -R www-data:www-data /var/www/example.com
6. a2ensite example.com.conf
7. service apache2 reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment