Get this out of my closet. Shop.
Recall from the first post the reason I began this blog, my best friend needed an outlet for her collection of artworks and body care supplies. Let’s take a look at how I setup her website.
Acquiring the domain and web space
I use Name Cheap for my domains. They’re pretty cheap with a fairly easy admin dashboard. I usually get the domain then point the DNS records to Digital Ocean (DO) where I acquire web space. DO makes it really easy to get space on the web and point your domains to their droplets, but that’s a tutorial for another time, if you’re interested let me know in the comments.
Setting up the website directories
Using a droplet I already own, to keep costs down, running Apache2 I put one website in /var/www/website1.com
and added /var/www/getthisoutofmycloset.shop
. Allowed my non-root user modification permissions, $ sudo chown -R $USER:$USER /var/www/getthisoutofmycloset.shop
, and allowed read access, sudo chmod -R 755 /var/www
.
Next I added a file within the shop directory labeled index.html
to show something that’ll tell me the virtual hosts are working:
<html>
<head>
<title>Get This Out of My Closet Shop</title>
</head>
<body>
<h1>Success! The virtual host is working!</h1>
</body>
</html>
Create the virtual hosts
Apache gives us a template that we can copy with $ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/getthisoutofmycloset.shop.conf
and edit to looks like this:
<VirtualHost *:80>
ServerAdmin thejenniferhaggerty@protonmail.com
ServerName getthisoutofmycloset.shop
ServerAlias www.getthisoutofmycloset.shop
DocumentRoot /var/www/getthisoutofmycloset.shop
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Afterwards we enable the site with $ sudo a2ensite getthisoutofmycloset.shop.conf
, restart Apache $ sudo systemctl restart apache2
, and test the results by navigating to http://getthisoutofmycloset.shop.
At the time of this writing it should show “Success! The virtual host is working!”.
Next up
Installing WordPress, SSL encryption, and WooCommerce.
Thank you for reading!