Wer sich richtig mit MySQL auseinandersetzen möchte muss natürlich alles ausprobieren, an jeder Schraube drehen und jede Detaileinstellung testen. Da intensive Tests nicht an einem Produktivsystem durchgeführt werden sollten, bietet es sich an auf eine virtuelle Umgebung auszuweichen, die vom eigentlichen System abgekapselt ist. Eine solche Testumgebung lässt sich sehr leicht mit der kostenlosen Software VirtualBox realisieren. Eine genaue Anleitung dazu habe ich im Blog zum MySQL-Buch verfasst.
Recently I noticed an interesting behavior of my Apache2 setup when I introduced a new VirtualHost and enabled the site. Usually I store the configuration for each host in an individual file, because it is much easier to maintain. The main page that I serve is this WordPress blog, having the ServerName blog.stefanproell.at and several aliases. The configuration files have the same name as the ServerName of the VirtualHost they configure. When a request comes in, Apache2 passes it to the first VirtualHost having a server name or alias fitting to the request. If no atch can be found, the request is handled by the first VirtualHost that can be found. This is obviously the one having the config file with the alphabetically first file name. Without noticing, the first config file to be read was exactly this blog. Other services and hosts have their configuration files names starting with letter being later in the alphabet than the blog, hence they were read later. So every unknown request was handed over to the blog, which is nice as I want to have it like this anyway.
But when I introduced a new host having a filename say 123.stefanproell.at for its config file, each request not to be answered by any host was handled by the new host 123.stefanproell.at. So far, this is no surprise at all, but then it got weird. As suggested by a lot of different sources and the official documentation, I declared a default page, having a filename with an alphabetically even lower letter: 000-default.
Also the directive especially designed for this porpose of having a wildcard VirtualHost did not work as expected. This directive
<VirtualHost _default_:*> DocumentRoot /www/default </VirtualHost>
should according to the documentation
prevent any request going to the main server. A default vhost never serves a request that was sent to an address/port that is used for name-based vhosts. If the request contained an unknown or no Host: header it is always served from the primary name-based vhost (the vhost for that address/port appearing first in the configuration file).
But instead of serving an empty default page for every missed request, Apache2 stated to serve every request to the default page, although the other VirtualHosts have been defined. The same behavioralso occurred when the specific
directive was not applied.
What I ended up with was a solution where I explicitly defined a dummy,catch all host having the lowest file name for its configuration. So now I have a fully configured VirtualHost having the configuration file name 000-dummy.stefanproell.at and the content
ServerAdmin webmaster@localhost ServerName dummy.stefanproell.at DocumentRoot /var/www/default
Do not forget to provide a DNS entry pointing to dummy.stefanproell.at as well.
During the holidays I finally found the time to upgrade my Samsung notebook by replacing the standard hard disk with a much faster SSD. There are plenty of tutorials available and the complete process is actually quite easy. For copying (and backing up) the data I used a docking station that can handle all kinds of disks, which is quite convenient for moving data between the two hard drives. My current setup consists of a “emergency” Windows 7 installation for anything which does not run with Linux and my main Linux Mate setup on a separate partition. In my case I only wanted to copy the Windows partition and install Mint from scratch as this is very easy with Linux o do.
What you will need:
- A new SSD (like the Sandisk Ultra Plus 256GB)
- Docking station
- USB stick with 2GB for booting a Linux Live distribution
- USB stick with 8B for booting a Windows repair console
- External backup disk
This are the steps I followed:
- Backup all important data to an external disk
- Boot the laptop from an Live Linux distribution by using the imagewriter software and an USB stick.
- Attach the new SSD to the docking station and attach the docking station to the laptop
- Launch gparted from the live system
- Copy the partitions you need by clicking right on it and select copy.
- In the upper right corner of gparted select the SSD
- Paste and choose 1 MB space between the previous partition, make sure to select “round to MiB”
- Repeat for all required partitions
- Shutdown the laptop and follow this instructions to open the case and replace the disk.
Then you can try booting from the new hard disk. If that fails you can try to use the Windows 7 USB stick in order to run the repair tools.
The Linux Mate installation is straight forward. Use the Linux USB stick to boot the Live system and install it as usual. After the system is installed, boot it and adjust the settings according to this tutorial.
The performance gain is even without tuning impressive. Boot time reduced from 2 minutes with the conventional drive down to 20 seconds with the new SSD setup.