Sync obsidian dirs to hugo dirs:
rsync -av --delete source destination
–delete flag deletes files in the destination directory if they do not exist in the source
From your laptop, yeet the files over to the /var/www directory on the server:
`rsync -rtvzP ~/Documents/blog/docs/ {username}@{servername or ip}:/var/www/public
Update file owner and permissions:
sudo find /var/www/public -type d -exec chmod +x {}\;sudo find /var/www/public -type f -exec chmod 644{}\;sudo chown -R apache:apache /var/www/public
Check active vhosts:
httpd -D DUMP_VHOSTS
Firewall Permissions
You will need to make sure your firewall allows port 80 and 443. Vultr installs the ufw program by default. But your can install it if you used a different provider. Beware, enabling a firewalll could block you from accessing your vm, so do your research before tinkering outside of these instructions.
Comment out ServerName and DocumentRoot directives in /etc/httpd/conf/httpd.conf file.
Get rid of userdir.conf
sudo mv /etc/httpd/conf.d/userdir.conf /etc/httpd/conf.d/userdir.conf.old
Comment out /etc/httpd/conf.d/welcome.conf:
# # This configuration file enables the default "Welcome" page if there# is no default index page present for the root URL. To disable the# Welcome page, comment out all the lines below. ## NOTE: if this file is removed, it will be restored on upgrades.##<LocationMatch "^/+$"># Options -Indexes# ErrorDocument 403 /.noindex.html#</LocationMatch>#<Directory /usr/share/httpd/noindex># AllowOverride None# Require all granted#</Directory>#Alias /.noindex.html /usr/share/httpd/noindex/index.html#Alias /poweredby.png /usr/share/httpd/icons/apache_pb3.png#Alias /system_noindex_logo.png /usr/share/httpd/icons/system_noindex_logo.png
Create vhost file:
sudo vim /etc/httpd/conf.d/vhost_{sitename}.com
Restart the httpd service:
sudo systemctl restart httpd
Set Up a Cronjob to automatically Renew certbot certs
crontab -e
Select a text editor and add this line to the end of the file. Then save and exit the file:
0 0 1 * * certbot --httpd renew
You now have a running website. Just make new posts locally, the run “hugo” to rebuild the site. And use the rsync alias to update the folder on your server. I will soon be making tutorials on making an email address for your domain, such as david@perfectdarkmode.com on my site. I will also be adding a comments section, RSS feed, email subscription, sidebar, and more.
Feel free to reach out with any questions if you get stuck. This is meant to be an all encompassing guide. So I want it to work.