Step 1: Buy the Domain
I usually use Namecheap or Misk to buy the domains.
Step 2: Change the Nameservers
On Namecheap, go to your domain page, then to the Advanced DNS section, and under DNS/Host Records choose Custom for the Domain Nameserver Type. Then I go and enter in my custom domain name servers. I use linode, so the entries are
ns1.linode.com ns2.linode.com ns3.linode.com ns4.linode.com
Step 3: Create the DNS Entries
I manage all of my DNS on Linode. Since I’ve used the same configuration many times, I go into linode, then to the DNS manager, then scroll to the bottom and select “Clone Existing Zone.” I’ll clone a DNS configuration for an existing Flipside website into a new one. The main entries that are created are the mail, www, and root (or @, a blank — like website.com instead of www.website.com) to the IP of my server.
Step 4: Setup Up Name Based Virtual Host and Destination Directory
I have an apache server setup, so I need to make a new file to configure the virtual host.
// Go make the new file. // I copy an old config to a new one.
$ cd /etc/apache2/sites-available/ $ sudo cp dhsflipside.com hoosierflipside.com
// Then I go into vim and substitue the new name for the old name.
Using this vim command :%s/dhs/hoosier/g
1 <VirtualHost *:80> 2 3 ServerAdmin [email protected] 4 ServerName hoosierflipside.com 5 ServerAlias www.hoosierflipside.com *.hoosierflipside.com 6 DocumentRoot /home/flip/hoosierflipside.com 7 8 <Directory /home/flip/hoosierflipside.com> 9 Options Indexes FollowSymLinks 10 AllowOverride All 11 </Directory> 12 </VirtualHost>
// Enable the site so it goes into the sites-enabled directory $ sudo a2ensite hoosierflipside.com Enabling site hoosierflipside.com. Run ‘/etc/init.d/apache2 reload' to activate new configuration!
// Then go make the new directory and index file to test this // configuration. I just write a test // sentence in index.html
user~$ mkdir hoosierflipside.com user~$ cd hoosierflipside.com/ user~/hoosierflipside.com$ ls user~/hoosierflipside.com$ touch index.html user~/hoosierflipside.com$ vim index.html
// Then restart apache
$ sudo service apache2 restart * Restarting web server apache2 … waiting [OK].
Step 5: Test That This Works So Far
Test that this works so far by visiting your domain. You should see the contents of your index.html file. If you visited the domain too early (like I did on this tutorial), then you may have cached the landing/parking page of the DNS registrar. You can try clearing the cache using
sudo dscacheutil -flushcache
But sometimes you will just have to wait to clear the DNS cache. I also tested on my phone by visiting the page to show that the domain name → nameserver → DNS configuration → name based virtual host → index.html file all works.
Step 6: Install WordPress
Now it is time to install wordpress, using the “5-minute install” https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install.
Get wordpress
$ wget http://wordpress.org/latest.tar.gz $ tar -xzvf latest.tar.gz $ mv wordpress/* .
Make the database
mysql> create database <DATABASE_NAME> character set utf8; Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on <DATABASE_NAME>.* to <DATABASE_USER>@'localhost' identified by ‘<PASSWORD>'; Query OK, 0 rows affected (0.01 sec)
$ mv wp-config-sample.php wp-config.php $ vim wp-config.php $ rm index.html
Change database user, name and password in wp config.
Dont forget to change file permissions on the directory
$ sudo chown -R www-data hoosierflipside.com/
Step 7: Thats it!
Visit the website to complete the configuration, but that should be it!