Domain and Wordpress in 30 minutes
In this post I will describe what I just did: grab a domain name, install Wordpress and get blogging in 30 minutes. This all assumes you have access to your own (Ubuntu) Apache webserver and some basic skills. If you don't have that, Google's your friend. If you want me to write a tutorial on how to set up your own webserver, leave a comment.
1. Get your domain name
Go to Go Daddy to get your domain. I used the search bar to find an available address (not so easy these days) and skipped through all the extra offers they wanted me to take (I didn't fell for that) until I reached the checkout screen. In another tab window you can search for Go Daddy coupons! You can get .com domains for $6 at the moment. Enter the coupon code and finish the order.
2. Configure DNS and Apache
In Go Daddy, go to my account, domains, click launch and then below DNS manager click again launch. Change the first entry (under 'A (Host)', item '@') to the IP address of your server. Save.
Now on your server, create the file /etc/apache2/sites-available/yourdomain (you may name it differently but then mind the next step). And fill it like so:
<virtualhost *:80> ServerName www.yourdomain.com ServerAlias yourdomain.com *.yourdomain DocumentRoot /var/www/yourdomain <directory /var/www/yourdomain/> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </directory> ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined </virtualhost>
Note that /var/www/yourdomain may be something different, but than you should stick to that in later steps as well!
Now go to /etc/apache2/sites-enabled and type sudo ln -s ../sites-available/yourdomain 009-yourdomain
Now go to /etc/apache2/sites-enabled and type sudo ln -s ../sites-available/yourdomain 009-yourdomain
Now restart apache sudo /etc/init.d/apache2 restart
3. Get Wordpress
- Note: some commands might require sodu!
- Go to /var/www and create a new folder: mkdir /var/www/yourdomain
- Change group to www user: chgrp www-data /var/www/yourdomain
- Go to /var/www/yourdomain.
- Get Wordpress: wget http://wordpress.org/latest.tar.gz
- Unpack: tar xvfz latest.tar.gz
- Now I like to do: mv wordpress/* . and then: rm wordpress -r
- Change group to www user: chgrp www-data * -R
4. Make database and configure Wordpress
Open mysql prompt: mysql -u.... -p (you should know your username and password...often this boils down to root / root). Type: create database mydomain (other db name by your chosing is ok, mind later on though).
Open your webbrowser and go to www.yourdomain.com. Should work... Enter mysql database name, password, location (often localhost). Continue configuration. At some point you are stuck. Copy paste the configuration text into /var/www/yourdomain/wp-config.php and continue (in the browser). You should be able to finish the process now.
5. Install stuff without ftp
Finally, set the permissions on /var/www/yourdomain/wp-content:
- cd /var/www/yourdomain/wp-content
- chmod g+w .
- chmod g+w * -R
And in my case, I also had to edit /var/www/yourdomain/wp-config.php:
- cd /var/www/yourdomain/wp-content
- vi wp-config.php
- Add this line: define('FS_METHOD', 'direct');
Note that this is not safe if there is other websites on your server that you don't trust
Wrap up
You should now have your blog available. You can install plugins and themes right from the Wordpress admin console in your webbrowser, from a white beach in a sunny place. If you have questions or additions to the above, feel free to leave a comment!