Using Ghost on Uberspace on a subdomain

The guys at Uberspace already wrote a good article on how to setup the blogging engine Ghost on Uberspace. Unfortunately that does not include how to setup it on a subdomain.

To setup the htaccess file use your subdomain path instead of ~/html

$ cd /var/www/virtual/youruser/sub.domain.tld
$ cat <<__EOF__ >> .htaccess
RewriteEngine On
RewriteRule ^(.*) http://localhost:$GHOSTPORT/\$1 [P]
__EOF__

Important

Don't put your ghost installation in ~/html/ghost or in your /var/www/virtual/youruser/sub.domain.tld/ghost folder but instead directly into your user folder ~/ghost. It doesn't matter where you put it for the Ghost installation, but it matters for you for security reasons. If you put it into ~/html/ or any subfolders (same with subdomains) it's possible that attackers can get into those files and get access to your database and login credentials for your mail server.

So just put it into ~/ghost and you'll be safe.