Install Dropbox using Ubuntu Command Line

I wanted to install Dropbox on the WordPress server so that I could easily update theme files on my notebook and have them sync with the server. I also wanted a simple backup of all the modifications done to the server. These are the steps of how I went about installing Dropbox using the command line.

  1. Log in the server and change to your home folder.
  2. Get the latest version of dropbox:
    wget –O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86
  3. Extract the tar file:
    tar xzf dropbox.tar.gz
  4. Run dropboxd:
    ~/.dropbox-dist/dropboxd


    The process will output something like:

    Please visit https://www.dropbox.com/cli_link?host_id=c506e627a5fc9cfa2240c6355d8cc0e5&cl=en_US to link this machine.
    This client is not linked to any account...

    Enter the link into your browser and follow the setup process. Then once the messages stop and say that the server is linked to an account, kill the process with control-c.

  5. Next I created a start-stop-daemon script to auto run Dropbox when the system starts. The details for creating the script are on the Dropbox Wiki. I did Steps 1&2. Make sure to change DROPBOX_USERS to include the user (in my case “bitnami”).
  6. Next I did a bit of symbolic linking to WordPress files. Back in the terminal, cd into your Dropbox folder and run the following commands:
    ln -s /opt/bitnami/apache2/conf/ apache2conf
    ln -s /opt/bitnami/apps/wordpress/ wordpress

That’s it for the Dropbox side of things. After it syncs I can happily work without logging into the server so much. The other thing that I’ll do later is to schedule a database backup and sync that to Dropbox as well. I’ll also wrap up my Dropbox folders using another backup service as well just to be on the safe side.

 

Posted in Uncategorized | Leave a comment

Change WordPress to the Default URL (BitNami/Ubuntu)

In our previous two posts, we set up a new WordPress server running on Amazon EC2 using the BitNami WordPress server image and then pointed a custom domain at the new server. Now we are going to change the default URL so that we don’t need the “/wordpress/” on the end.

  1. Open a new terminal window. This will depend on your operating system.
  2. Change to the directory containing your key file wpserver.pem. Then enter the following command, replacing your server name:
    ssh –i wpserver.pem bitnami@www.badfrogbyte.com
  3. Edit your Apache configuration file using the following command:
    sudo nano /opt/bitnami/apache2/conf/httpd.conf
  4. Locate and change the document root location to
    /opt/bitnami/apps/wordpress/htdocs

    :

  5. Locate the Directory section in the file that looks like this:

    Change it to:
  6. In the same directory section, change AllowOverride to All:
  7. And, comment out the wordpress.conf include line towards the end of the file:
  8. Exit nano and save the file.
  9. Update the WordPress database to use the correct URL. If this step isn’t followed, the CSS for your site may not show. (enter bitnami as the password):
    mysql -u root -p -e "USE bitnami_wordpress; UPDATE wp_options SET 
    option_value='http://www.badfrogbyte.com/' WHERE
    option_name='siteurl' OR option_name='home';"
  10. Next run the following command, replacing with your IP address:
    sudo /opt/bitnami/updateip --machine_hostname 50.19.238.143
  11. And:
    sudo mv /opt/bitnami/updateip /opt/bitnami/updateip.bak
  12. Then restart apache using:
    sudo apachectl -k restart
  13. Browse to your site and you should see WordPress by default.

Helpful links: http://wiki.bitnami.org/Applications/BitNami_Wordpress_Stack

Posted in Uncategorized | Leave a comment

Custom Domain Name for WordPress (BitNami/Ubuntu)

In the previous post, we set up a new WordPress server running on Amazon EC2 using the BitNami WordPress server image. Now we are going to point a custom domain at the new server. In this instance, the domain name I am using is www.badfrogbyte.com.

  1. Set up an Elastic IP address for your server. It is a good idea for public servers to have IP addresses. If down the track, you want to decommission the server and start up a new one, you don’t have to go through the hassle of waiting for DNS records to update as you can use the same IP address and just point it to the new server.
  2. Go to the management console, select “Elastic IPs” and then “Allocate New Address”.

    Click “Yes, Allocate”.
  3. Then select “Associate Address” and select the WordPress Server instance.
  4. Your server now has a static IP address. Test it out by browsing to the IP address.
  5. Now we need to add an A Record to your DNS Records. To update the DNS settings, you will need to log into your provider (I’m using enom.com for this domain) and add/update an A Record for “www” and point it to your new IP address. The details will vary slightly depending on who you are registered with.
  6. Now, you should now be able to access your server using the new the custom domain name. In my case, www.badfrogbyte.com/
  7. Next, we want to change to change WordPress to be the default and not have to use www.badfrogbyte.com/wordpress/ to get there. Check out my next post: Change WordPress to the Default URL.
Posted in Uncategorized | Leave a comment

How to Setup an Amazon EC2 WordPress Server

It is incredibly easy to set up a WordPress server on Amazon EC2. Setting up your own server can provide a lot more control over your website. There are some dis-benefits to the approach as you could potentially lose out on support options and will need to handle your own upgrades. However, depending on your circumstances, the flexibility provided by running your own server can more than make up for it. Contact me if you need a hand – my rates are reasonable!

Setting up a WordPress Server:

  1. If you haven’t already, sign up to Amazon for an AWS account. If you are a new customer you can qualify for the AWS Free Usage Tier which will give you a free server (Micro Instance) for a year. Once you have completed the sign-up process, continue to the next step.
  2. Time to launch the server instance. For the server I have chosen to use a BitNami image. Have a look at the list of latest images to locate the latest image name to use.

    I have chosen to use an Ubuntu server with EBS as the root device. EBS means that you can safely shutdown the machine and turn it back on without losing any data. I’ll cover WordPress backups in a later blog post.
  3. Sign into the Management Console.
  4. Click “Create Instance”

    Search for the image and click “Select” to continue.
  5. Enter the instance details. I have selected a Small instance.

    Click “Continue”.
  6. Next, leave the options defaulted – unless you want to change the default behaviors.

    Click “Continue”.
  7. Give your new server a name:
  8. Next, create and download a new key pair. Make sure that you save the private key to a safe location on your computer and make the key file read only and remove permissions for other users. The key is used later for safely connecting to the server via ssh.
  9. Create a new security group for the server. This will act as the firewall for your new server instance. Create a security group called “wpserver” and add inbound port rules for port 80 and port 22.

    Click “Continue”.
  10. Review the details and click “Launch”.
  11. Select the new instance and scroll down to locate the public DNS address. Enter this address into the web browser to browse to the new server. You can log into the WordPress application using: user/bitnami. The first thing I advise to do is to change the WordPress password to something more secure.
  12. There you have it. Your new server is up and running. In the next post we will point a custom domain name at the WordPress server.
Posted in Uncategorized | Leave a comment