Dreamhost must’ve had an outage of some sort this (last) morning. I noticed a little after 11 that I couldn’t upload anything to or log into my (shared) server. My sites were inaccessible. I tried the sites of a couple other people I know using Dreamhost (also shared), and they were also inaccessible, so it must’ve been something somewhat significant. Strangely, nothing relevant was on Dreamhost status. I tweeted about it at 11:20 and got a response from DreamhostCare that they were looking into it. They didn’t say anything more, but I noticed things were up and running again around 11:42. I found later that it must’ve been a DDoS on their nameservers. Outages have been rare, but certainly annoying when they happen.
server posts page 3
Got moved to a new server in a new datacenter by Dreamhost this weekend. Seems to be significantly faster than the old one for first page load, like an order of magnitude. It’s more in line with what I get when testing locally. I assume the server I was on was just overloaded. It had often had a load average in the 6’s or 7’s. I had been wondering what was wrong and if I should swtich to VPS. This one’s been at less than one. Hopefully it stays snappy and doesn’t get too loaded up over time.
Dreamhost now supports LetsEncrypt even with shared hosting. LetsEncrypt provides free SSL certificates. I’m going to have to try it out on my domains. My plan is to make my visitor targeted domains have https as the canonical protocol but still support http for older browsers.
And we’re back
I haven’t posted anything on this site since 2011. My “professional” site and related blog took my attention as I focused on my career. In 2011, this site was hosted from my home on an iBook. That server probably was taken down within a couple years of that post when I moved and didn’t bother trying to get it back up and running. By that point, I had my “professional” site on a shared host (Dreamhost) and liked what it had to offer. I no longer had to worry about keeping my IP updated with DynDNS or the downtime from internet outages (common with my Windstream DSL), server problems, router problems, etc.
This site was down for a period, but at some point I migrated it over to my Dreamhost server. I started it at personal.tobymackenzie.com. After a while, I decided it needed its own domain and would be a good candidate for a .name domain, so I bought tobymackenzie.name. The site was still not fully functional though. Some pages and sections were completely broken, and for a while I couldn’t log into the WordPress install this blog is run with.
Recently, I went through and got most things working and threw a more recent, responsive theme (Twenty Fifteen) onto the blog. A few sections still don’t work. I may have lost the data for the almost never used forums. The gallery is run by software that shared photos from my iPhoto library, no longer possible on shared hosting. I may replace these at some point, though I would probably only put the forum back in a read-only mode for posterity.
Anyway, this site is old and outdated. Some of the information is inaccurate. At some point soon, I intend to replace it with something new, probably something built on Symfony. I hope to merge the code-base and some of the content of my “professional” and personal sites, though in appearance and most content they will remain separate to serve their own purposes most effectively. I will leave this site as is on a sub-domain for posterity. As with most of my personal projects, who knows when I will actually get to it, but I have been itching to play with some things that I don’t get to at work.
As to this blog, I hope to get back into the habit of writing for it. I’ve put a lot of focus on my career lately, but miss thinking and writing about some of my other interests. It can be somewhat therapeutic to write down my ideas or about things happening in my life. Lately, my interest in homes and architecture has been coming back. Hopefully, this blog will be seeing me as regularly as it once did and my thoughts will be archived for my future self and others.
Load Balancers and HTTPS
Until recently, I had no experience working with sites behind load balancers. Cogneato has been moving its sites to Rackspace virtual servers for flexibility, among other things. One of their recommendations that we took was to put our web server behind a load balancer. Even though we haven’t needed multiple nodes behind it yet, it makes it easier to upgrade the server behind it without needing to change IPs in DNS and will allow us to easily pop up another node when it is needed.
This arrangement has gone relatively smoothly except a few issues. The biggest ones have had to do with our HTTPS sites. We run both HTTP and HTTPS sites on the same server. We put the certificates on the load balancer, so traffic goes from the load balancer to the web server over HTTP. Both Apache and code see the request as HTTP as standard methods are concerned. I will discuss some of the problems we had and solutions I found.
Continue reading post "Load Balancers and HTTPS"hosts file to access local servers
Ever since I had to change to a Speedstream router instead of my old 2wire (constant and still somewhat present connectivity difficulties), I had been unable to login in to my WordPress install locally. This was because the Speedstream redirected traffic calling the external URL or IP from inside to itself rather than forwarding the request to the server, and because WordPress requires a single fixed URL reference in its database that it automatically redirects to.
I worked hard trying to get the router itself to not do this, but instead the problem was fixable on my computer itself: the hosts file, as I found on this post. You simply edit the hosts file:
$ sudo vi /etc/hosts
and then place an entry like “accessURL externalURL” for another machine, ie:
tobysServer.local cosmicosmo.ath.cx
or modify a localhost line for a local machine (haven’t tried this yet):
127.0.0.1 localhost
becomes:
127.0.0.1 localhost cosmicosmo.ath.cx
Or possibly you could just do as for another machine and access by the LAN address rather than localhost (haven’t tried this either, just speculation).
This was very quick and easy to do and works like a charm. I haven’t seen what happens if my WAN network access goes down with this method: I imagine it would cause problems accessing any part of the site.
One problem I’ve already found with WordPress and this method is that many links don’t work because they contain the full URL. Examples include the Preview button and the all post links. You must copy the link and past it, replacing the hostname bit. But all the admin links work, at least the ones I’ve tried. Tag autocompletion doesn’t seem to be working either, but I’m not sure if that is a browser compatibility problem with this new 2.7 version or a plugin (simple tags) conflict.
WordPress and SVN
I’ve been thinking about it for a while, but I finally decided to use subversion to update my wordpress instead of the download, copy over to server, copy in all old files method. Details on using SVN with wordpress can be found on WordPress.org.
Since it was my first time, I had to do an initial install so that all the subversion tracking data would be there. The command for installation, which would be used for a new install, was just a simple one line thing with the url of the install and a few flags. Then I had to copy over my htaccess, wp-config, and wp-content, all simple and easy.
Because this brought me up to date, I was unable to try the update type commands. But it seems extremely easy, just a one line command again, plus the web based upgrade script.
This should make my upgrading much faster and easier, and so lessen the delay between upgrades.
[Update 09/01/10]The steps, which I should have included before:
$ cd blogpath
# for trunk versions you can simply update
$ svn up
# OR for full point revisions, you must use the switch command to change versions
$ svn sw http://svn.automattic.com/wordpress/tags/2.7/ .
[browser]updgrade.php
[/update]
[Update 2/13]I’ve now done an update via subversion. It was in fact extremely easy, just one simple command line command followed by the upgrade.php script. Everything works fine, no copying and moving files and what not, although a backup is a good idea.[/update]
back on mac os x
I guess I forgot to mention it, but my server is back to running the mac os, and it has been for a good while now. My brother had sent the install DVD finally. I erased the old partition and installed the OS cleanly, then copied over my files from backup, which I’m glad I’ve finally been doing. Of course, I could have backed them all up before wiping the drive in this instance, but it could have been worse, and there may have been some file corruption of some sort.
Unfortunately, I forgot to backup some of the files that weren’t in my home folder. Mainly game related stuff. I lost nearly my entire collection of video game ROMs, which I’ve been having trouble finding now. I also lost some game saves, including some EVN ones that I had spent some time setting up. This has led me to start doing an occasional backup of the entire boot drive. This was made possible by my purchase of a 120GB drive.
I have recently purchased a new computer for use for myself. This one will become server only. I may take it back to linux once again for less overhead and what not. The new computer is just an updated version of my iBook G3, an iBook G4. It will be nice to again be able to take my computer elsewhere without taking down the server.
mac drive troubles; now using ubuntu
A few weeks ago, I came home and my iBook crashed. One app after another gave me the spinning beachball of death, until I could do nothing but move the beachball. I restarted, and no startup disk was recognized. I restarted several times to no avail. Finally I shut down and then started it up. It booted, but then all the apps quickly started crashing again.
I booted using a Techtool 4.0.1 disk. It was ridiculously slow. The volume structes test took 8 hours, and told me I had a problem and needed to rebuild the structures. I told it to do its thing. It took another 8 hours. Rebooting after that, my disk was no longer found again. I gave up on the problem then, and decided to install linux so I could get my server up and running as quickly as possible (see below).
Later, I got a new version of Techtool from my mom that was on a thumb drive. It allowed me to do much more, such as run disk utility and a terminal window. Disk utility could not fix the disk though and I couldn’t access it with terminal. I ran its test of the volume structures. It was crazily faster than the other one, taking perhaps 10 minutes for the test. It went so fast I felt hopeful it could fix it. It said there was a problem. I fixed it and ran the test again, but unfortunately it said there was the same problem as before, a directory node missing or something like that. I tried fixing and retesting a couple more times, but it gave the same problem every time.
I can access the files from linux, but have had no luck writing to the drive. I imagine the old version of Techtool, as it was from the early days of OS X, did not know how to properly handle the current volume structures, so it messed them up. I think I will need to reformat the drive and reinstall everything. Luckily, after my previous drive problems, I have been backing up most everything weekly. I shouldn’t lose anything, though I do want to look through the drive before I erase it just to make sure. I also want to try to find a way to only reformat the partition affected, so I don’t lose my linux setup or any of its data. I’m not sure how to do that for HFS+ without buying another utility.
Linux
I had burned a Gentoo and Ubuntu CD a couple of years back to mess around with. I never got either installed then, but this time it was more necessary. I tried installing the Gentoo. The installation is not directly guided at all; I had to open up a webpage (luckily the internet was no problem to get working) in one terminal window (no gui) and carry out the steps from the instructions in another. I was going along alright, but some of the choices were a little confusing. I came to the point where I had to compile my kernel, and decided I was spending too much time with Gentoo. Ubuntu was supposed to be quick and easy to install, and this was only to be temporary anyway.
Ubuntu provided a guided, GUI install that was fairly easy. The only problem I had was choosing the (prebuilt) kernel, as the default one didn’t work. I got that up and running, and it started up easily with a GUI and the internet working just fine. It was the desktop version, though, so no server stuff was installed. I was able to install apache2 with the package manager, but could not find php 5. I had converted all of my site stuff to mysqli, so I needed php 5: I certainly wasn’t going to go through my files and change all the pertinent lines for a temporary server. Searching the web, I found php 5 available for the Edgy and some other versions of Ubuntu. I was confused as to what those different versions were, at first thinking each one was of a progressively more unstable branch. I changed my repositories that I was getting packages from to one that had php 5, after figuring out how to do that. It wouldn’t let me install because it said there were some dependency problems. By this time I figured the different word versions of the OS were actually newer and newer revisions, like Jaguar and Tiger for OS X. So I figured if I installed the entire new version with the package manager, then all the dependencies should be met. It took quite some time to download and install all those files, and it gave some errors before completing. At that point, things like the GUI started breaking. I tried hard to fix the problem, including manually removing some package files, but it kept giving me errors.
I got the GUI back up and running just so I could burn another CD of a new version of the OS. I figured that then all the dependencies should be met no problem. I downloaded not quite the newest version though, as the newest couple of versions didn’t seem to mention the need mysqli in their depository (I now think mysqli is installed automatically with the mysql php extension in these versions). I downloaded the server version so that I could hopefully have a server running right from install. It took me some time to find a program that would let me burn a CD, but I finally got it burned.
Installing was about as easy as with the Desktop version, save for one screen where I had to manually select to install the web server, which I skipped the first two times through. To my delight, after the install, not only was an apache 2 server up and running, but so was a MySQL server, and PHP 5 with mysqli was already installed. After figuring out how to mount UFS (that took some time as well), I copied my site files over to the linux partition and easily got my site running.
Unfortunately, the server version wasn’t set up out of the box for my own regular use. It had no GUI at all. I used the package manager to install KDE, as KDE seems to have more applications that come with it. It took a good bit of time to set that up so it would actually work. It didn’t just work like it had when the desktop version was installed; it took some messing around with configuration files. When I finally got that working, it still was not working fully properly; I still have a desktop that is bigger than my actual screen, so I have to drag the mouse to the sides and move it to see the rest. This is very annoying to work with. I also have no sound. Other than that, though, it works just fine.
Linux seems to work quite nicely. It has plenty of good applications available, of course for free. I was able to work with all my important Excel files in OpenOffice with the only problem being that if I made changes, I had to save them in the OpenOffice format. I was surprised that the Control-enter functions worked. After downloading several extensions, I’ve been able to get firefox to work mostly the way I want for browsing. Safari still works better in some ways as I had it set up, but there are a lot of cool things that can be done with firefox extensions that can’t be done in Safari. Kate is a very nice text editor, though unfortunately I’ve not been able to find anything with live PHP previews like Taco Edit. It of course has desktop paging, which I never got working nicely in OS X. App launching has been a problem though. I’m used to Butler. Linux has Katapult, but it is not nearly as good and is very slow. File browsing is quite nice for the most part. The image browsing capabilities of Konquerer far exceed those of the Finder. I miss the Next-like columns view though.