Running Multiple Sites on Your Local Apache Server via Virtual Hosts
Posted by Johnny on April 7th, 2009 filed in Guides, TechnologyComment now »
Disclaimer: I only recommend doing this on a local dev box, as I don’t know what sort of (in)security implications this may have.
There are times when, for the sake of convenience or testing, you may want to run multiple sites off your local machine. This can be accomplished by setting up a virtual host in Apache and tinkering with the port numbers. Looking in your /etc/apache2/sites-available/ directory you’ll notice a default file. Make a copy of this and name it whatever you’d like (perhaps the name of your site), then open it up in a text editor. Change port 80 in the first line, <VirtualHost *:80>, to some unused port number, and the DocumentRoot directory to that of your other site. You may also want to change some other variables such as ErrorLog so as to not conflict with other sites that you’re running.
Then open up NameVirtualHost *:<port_number> Listen <port_number> For additional information on virtual hosts, including how to have IP-based (rather than port-based) virtual hosts, take a look at Apache's virtual host documentation. /etc/apache2/ports.conf and add
where <port_number> is the one you specified in the new site configuration, after the existing defaults for port 80. Going back to /etc/apache2/sites-available/, run the a2ensite command on the site configuration file you just created, then restart Apache with sudo apache2ctl restart. You should now be able to hit your other site via http://localhost:<port_number>/. To later disable this site, run the a2dissite <config_file> command.
Setting up a Local Apache2 Server on Ubuntu
Posted by Johnny on April 7th, 2009 filed in Guides, TechnologyComment now »
Getting an Apache2 server running on your Ubuntu box for some local dev work is pretty easy. Install the apache2 package via the Synaptic Package Manager or sudo apt-get install. Unlike normal Apache2 installs though, the default Apache install in Ubuntu is located under /etc/apache2/.
Without getting into nitty-gritty configuration details, most users will probably want to change the directory that the server reads files from. To do this, open up /etc/apache2/sites-available/default in a text editor of your choice, and change the DocumentRoot to the directory that you wish to serve your files from. Restart your server by running either sudo /etc/init.d/apache2 restart or sudo apache2ctl restart. Then simply hit http://localhost/ in your web browser to view.
For additional details on how to set up the full LAMP stack, take a look at this HowtoForge tutorial.
Dual Booting on the e6400: Part Three – Setting Up Ubuntu Intrepid Ibex
Posted by Johnny on April 5th, 2009 filed in Guides, TechnologyComment now »
Similar to the XP Setup post, I won’t be covering the actual Intrepid installation (which is made incredibly easy by the guided install). I’ll be going over the major pieces of software I installed, and finishing up with some comments about various issues I ran into. Note that this guide is written under the assumption that one has some understanding of how to use a *nix OS, with much of the information coming from the Ubuntu Intrepid Ipex Guide
I must also apologize for how long it took to publish this post. I wasn’t (in fact, I’m still not) satisfied with the formatting of this post, which kept me from putting it out for you all to see. But I noticed a lot of people reading the previous two in the dual boot series, and figured some of you might be wanting part three (seeing comments would have resulted in a faster post folks :p)
Some Notes Before You Start
Software can either be installed with sudo apt-get install in a terminal, or via System -> Administration -> Synaptic Package Manager. Choose the one that suits your fancy – I generally use the Package Manager, opting for the terminal when it’s easier to just copy and paste a large list of software. Enabling additional repositories is also easier via the Package Manager, and can be done by going to Settings -> Repositories, where I generally enable all of them (main, universe, restricted, and multiverse). Additional repositories can be added by selecting the Third-Party Software tab and clicking add, entering the apt line in the window that pops up.
Essential Software
For those with laptop specs similar to mine, there are two pieces of software that I consider must-haves.
- NVIDA Graphics Driver
- Intrepid should ask you when you first log in if you wish to enable the driver. If it doesn’t, you can install it manually by going to System -> Administration -> Hardware Drivers and selecting the appropriate version. Note that you’ll probably have to agree to allowing the installation of proprietary drivers.
- gsynaptics
- This is the touchpad driver and software, found under the
gsynapticspackage. After the installation is complete, you can configure your touchpad by going to System -> Preferences -> Touchpad.
Highly Recommended Software
- Sensors Applet and i8kutil
- Both of these are applications for monitoring your system. Sensors Applet is a GUI applet that can be added to your toolbar (listed as Hardware Sensors Monitor), displaying various system component temperatures. Installing i8kutil will enable monitoring similar to the Windows-only i8kfanGUI, reading fan speeds in addition to component temperatures. These can be found under
sensors-appletandi8kutil, respectively. In order to enable i8kutil monitoring though, two additional steps must be taken. After installing, open up a terminal and runAddsudo modprobe i8k
sudo vim /etc/modules
i8kto that file, save and close. - Ubuntu Restricted Extras
- This package pulls in a number of commonly used packages including various media codecs, the Flash plugin, Java runtime, and Microsoft fonts (like Arial and Verdana). Note that, as the package name (
ubuntu-restricted-extras) suggests, these are pulled in from the restricted and multiverse repositories and may have certain restrictions on their usage.
Eye Candy
- Avant Windows Manager
- This enables a highly configurable and skinnable Mac-like dock for your OS. Check out the Avant Windows Manager section in the Ubuntu guide for installation steps. A number of themes can be found on the AWN wiki page.
- Compiz
- Less functional and much more eye-candy, this enables anything from glossier windows to fancy animations and effects when modifying windows (such as on resize, move, or minimize). Check out the section on installing Compiz in the guide.
A Few Notes and Tips
I leave you with some notes and tips about situations I ran into, that my readers may find useful. I make references in several tips to sda#. This refers to the ID of the particular partition that you’re working with – one way to find this if you know your partition sizes is by looking at System -> Administration -> System Monitor. Then under the File Systems tab, locate the device name matching the proper size.- Bug: Firefox toolbar config not saved
- Anyone that notices Firefox not saving their toolbar customizations when opening a new window can try disabling the Ubuntu Firefox Modifications plugin. Designed to integrate things like your system theme and apt support into Firefox (and thus not essential), it caused my Firefox to forget my toolbar config in certain situations.
- Changing your inode size
- As mentioned in part one, some of you may want to mount your Ubuntu partitions in Windows and find themselves unable to do so because of Intrepid’s 256 byte inodes. Those unable to use the simpler method of partitioning with Hardy Heron and GParted can try the steps I used myself for modifying my
/homepartition:- Zip up
/homeand store it on an external drive. Zipping the partition allows one to preserve some files that would otherwise not be copyable, such as certain symlinks. - Reboot with a live cd
- Run
mkfs.ext3 -I 128 /dev/sda#inside a terminal, where sda# is the ID of the/homepartition. - Unzip the file from step 1 back into
/home. - Run
chown -R <username>:<username> /home/<username>
chmod 644 /home/<username>/.dmrc /home/<username>/.IDCEauthority
- Find the UUID of the partition (as it will have changed after having run
mkfs) by doingsudo vol_id -u /dev/sda# sudo vim /etc/fstaband update the line representing/homewith the new UUID.
- Zip up
- Tip: Adding fonts
- Installing new fonts in previous versions of Ubuntu could be easily accomplished by dragging the font file into the system’s fonts folder. This folder needs to be manually created in Intrepid, which can be done in the terminal by running
mkdir ~/.fonts. - Tip: Keeping your system clean
-
Your Ubuntu system can become pretty messy after some use, with things like unused dependencies remaining after uninstalling packages. These unused dependencies can be removed by running
sudo apt-get autoremoveSimilarly, upgrading to new Linux kernels will start to clog up the grub boot loader with multiple kernel choices. If you wish to remove these, simply uninstall the relevant kernel packages, usually consisting of alinux-headers-<version>,linux-headers-<version>-generic,linux-restricted-modules-<version>, andlinux-image-<version>-genericpackage. More tips on cleaning your system clean can be found in this Make Tech Easier post. - Tip: Sharing Pidgin logs between XP and Intrepid
- Doing this requires permanently mounting your Windows partition in Ubuntu (this can also be done in Windows instead, but creating symlinks was too complicated for me to bother with). Determine the name of your Windows partition, and then, opening up
/etc/fstabin an editor, add/dev/<device name> /windows ntfs-3g defaults,locale=en_US.UTF-8 0 0
Export to Flickr Plugin for Lightroom
Posted by Johnny on February 21st, 2009 filed in Photography, Reviews, TechnologyComment now »
I’ve been using Jeffrey Friedl’s “Export to Flickr” Lightroom Plugin for about a month now, and I have to say that it’s a pretty solid plugin. My motive for finding an alternative to Flickr’s Uploadr was to automate my backup workflow – manually exporting all my RAW files to JPGs and then creating individual sets for everything would have been unnecessarily tedious, given that I had about four year’s worth of photos to backup.
My only complaint is with how the plugin handles errors. When something goes wrong, an error message pops up and the entire export process is aborted. While I can understand this when serious errors occur, I wish there was some sort of timeout-and-retry-before-aborting mechanism in place, especially in the case of not getting a response from Flickr, due to, say, your network connection going out temporarily. It’s a bit frustrating to leave Lightroom running overnight to backup several hundred photos, only to wake up in the morning and finding out that the export process aborted after the 10th image.
But again, a very solid plugin overall and I highly recommend it. And while it started as just a backup tool, I’ve begun to use it for publishing my public photos to Flickr as well. Based on subjective experience (I don’t plan to test for actual numbers), it seems as though Uploadr throttles the upload speed, with Jeffrey’s plugin pushing photos to Flickr at least three times faster, a speed boost which is more than welcome.
Editing Capture Time in Lightroom
Posted by Johnny on February 21st, 2009 filed in Photography, Technology, Tips & TricksComment now »
When taking photos in a different time zone, I usually adjust the capture time during post-processing in Lightroom, rather than directly adjusting the time and date on my camera. This is easily accomplished by going to Metadata -> Edit Capture Time, and choosing the second option in the window that pops up, “Shift by set number of hours (time zone adjust)”.
But about three weeks into my stay in Taiwan, I realized that the time on my Olympus C-5060 was completely wrong, being off by some 15 hours and 40 minutes, rather than the normal 16 hour time difference. Edit Capture Time didn’t seem to offer such fine tuning, only allowing the user to change all photos to one specific time, or by a set number of hours. It turns out that the “Adjust to a specified date and time” option is a bit misleading, and is, in fact, what I was looking for. When selecting multiple photos, the time you see in the Edit Capture Time tool is of the one photo that is the focus of that selection. When you change the time of this photo, all other photos in the selection have their capture time shifted appropriately, and are not all set to the same time as one is led to believe.
Been away working on my photos…
Posted by Johnny on February 14th, 2009 filed in Site Updates1 Comment »
Just a small update for my readers – I apologize for the lack of activity over the past few days. I’ve been preoccupied with eliminating a huge backlog of unedited photos from my trip to Taiwan, from this year as well as last. Those interested can take a look at my Flickr photostream.
As for the blog itself, I have a small backlog of topics that I plan to write about (in addition to finishing my Dual Boot Guide). Once the tech topics are done, there may be a short hiatus as I work on an actual site design plus the code necessary to begin my reviews of places to eat in Asia.
Lastly, readers, feel free to leave comments. In fact, I ask that you do, whether you find any of the information here useful, or feel that there are things I can do to improve your experience here.
Ignoring Files in Subversion with svn:ignore
Posted by Johnny on February 5th, 2009 filed in Technology, Tips & TricksComment now »
There may be times when you want to keep certain files out of Subversion. Examples of these include local configuration files and temporary files like those created by vim. Fortunately, Subversion has an option to specify exclusions, via svn:ignore. To do this, run the following in a terminal
svn propedit svn:ignore <parent directory of the files/directories to ignore>
This will open up a text editor where you can specify what to ignore, one file/directory per line. Remember that these are all relative to the parent directory you specified. Two things to note:
- The command is
svn propeditand notsvn propsetin a normal use case. The latter command is for migrating CVS ignore files, and will produce aExplicit target requirederror if you attempt to run it on a directory. - This only works for items not yet in the repository. If the file or directory was previously placed in Subversion, specifying it in the ignore file won’t have any effect.
Check out the chapter on ignoring unversioned items of the online Subversion book for more information, such as what file pattern syntax you can use in the ignore file.
Enabling Traditional Chinese Pinyin Input on Windows XP and Ubuntu Intrepid Ibex
Posted by Johnny on February 5th, 2009 filed in Guides, TechnologyComment now »
While enabling simplified Chinese in both Windows XP and Ubuntu Intrepid Ibex is pretty straightforward, getting traditional Chinese to work is a bit more roundabout.
To enable in XP…
Select the Languages tab and click Details. Also, make sure you’ve already installed the East Asian language files by checking the box below Details.
Click Add… and then select Chinese (Taiwan) for the input language. Microsoft New Phonetic IME 2002a should be selected by default under keyboard layout.
After clicking OK, make sure Microsoft New Phonetic IME 2002a is highlighted, then click on Properties… and choose the Keyboard Mapping tab. From that list, make sure HanYu Pinyin is selected, and click OK all the way back to the Control Panel.
To enable in Intrepid…
Scroll down the list and select Chinese. Then check the boxes for Input methods, Additional Fonts, and whatever else you find relevant. Also make sure that you’ve enabled support to enter complex characters by checking the box under Input method.
Right-click on the keyboard icon that should have appeared in the top right, near your clock (assuming you haven’t changed your configuration), and select SCIM Setup.
On the SCIM toolbar that appears, change 中 to 繁 to switch from simplified to traditional input. Note that there have been comments on how traditional Chinese input in Ubuntu isn’t very smart, with inputs sometime resulting in nonsensical phrases, so be wary of this.
Setting Up Subversion and ViewVC on Dreamhost
Posted by Johnny on January 29th, 2009 filed in Technology, Tips & TricksComment now »
While I don’t normally use source control for personal projects, I figured it would be a handy tool to sync files between numerous computers, and useful for a site that’s likely to go through many revisions. While setting up Subversion is pretty straightforward on Dreamhost, I sought an explanation for the /home/<username>/svn created after your first code import – it turns out this is where Subversion maintains your repository (I had naively mistaken it for a directory of checked out code). During this search I came across a nice how-to on Bernie Zimmerman’s blog about setting up ViewVC, an excellent web interface for viewing Subversion repositories, and one that I had used extensively back at Yahoo!.
Once installed, you can access ViewVC by hitting http://domain.com/path/to/viewvc.cgi. For those who prefer a prettier URL (also useful for accessing files directly by path) in the form of http://domain.com/path/to/viewvc/path/to/file, follow the directions in this Bat Country post on setting up Apache mod_rewrite directives to achieve this.
One last feature I felt like adding was the ability to view my repository directly by hitting my top-level SVN URL, rather than entering the full path to ViewVC. To do this, create an index.php file at your domain root with the following code
<?php header("Location:http://domain.com/path/to/viewvc"); ?>
which will redirect you to ViewVC when you hit http://domain.com/.
Dual Booting on the e6400: Part Two – Setting Up Windows XP
Posted by Johnny on January 26th, 2009 filed in Guides, TechnologyComment now »
As the title suggests, I’ll only be covering the post-XP install setup for the Latitude e6400, as there are many other resources out there outlining the installation already, like this XP Installation and Upgrade guide from Paul Thurrott’s SuperSite. Make sure you decide on a partitioning scheme to use for your dual boot system, and create the Windows partition accordingly. If you choose to follow Paul Thurrott’s guide, this comes between steps five and six. Just delete the current C: partition, and then create a new partition in the raw space of whatever size you decide on.
Following Dell’s driver installation guide and getting the setup files from their Drivers and Downloads section, an outline of my setup steps is shown below. Unless described as optional, consider it a must-install. Note that it’s best to download the appropriate files before you begin reformatting and store them on an external hard drive or USB flash drive, as the files should be installed prior to doing a Windows Update. Also, it’s highly recommended to restart after each installation completes. Lastly, keep in mind that the exact links to software you need may differ from the ones below – these are the files needed for a e6400 with specs similar to mine.
-
System Software [System Utilities -> Dell Utility: System Software]
OS updates and patches. This is a must, as other drivers may not work if not installed (I know from experience that the webcam driver won’t install properly, and may cause Windows to blue screen immediately after login).
- Chipset [Chipset -> Intel Driver: Mobile Chipset]
-
Intel Matrix Storage Manager Driver [SATA Drives -> Intel Driver: Matrix Storage Manager - Notebooks]
I believe this is a driver for RAID, and as such, may be unnecessary if you do not plan to use it. I installed the driver to be on the safe side.
-
Intel Matrix Storage Manager Application [SATA Drives -> Intel Application: Matrix Storage Manager - Notebooks]
I believe this is an application for managing your RAID setup, and as such, is unnecessary if you do not plan to use it. I skipped this install.
-
Audio Adapter [Audio -> IDT Driver: 92HDxxx HD Audio]
-
Video Adapter [Video -> nVidia Driver: Quadro NVS 160M]
-
Network Interface Card [Network -> Intel Driver: 825xx Gigabit Platform LAN Network Device]
-
Driver for the built-in SD card reader.
-
ControlPoint System Manager [Applications -> Dell Application: ControlPoint System Manager]
Application to manage general laptop settings like the ambient light level and power management. While not a must-have, it’s a definite nice-to-have that doesn’t seem to impact performance much.
-
ControlPoint System Manager XML File [Applications -> Dell XML File: ControlPoint System Manager]
XML file that contains settings for the System Manager’s All Day Battery Life Config. Another nice-to-have, but note that System Manager is a prerequisite for this.
-
Control Point Security Manager Driver [Applications -> Dell Driver: ControlPoint Security Manager]
Driver for the USB thumbprint reader. Necessary if you plan to use the reader, but I opted out. Dell’s Security Manager is a performance hog and slows the entire system down, and fingerprint recognition seemed to be hit or miss during the time I used it. Also note that, supposedly, you won’t be able to use alternative software due to how it’s hooked up (see the NotebookReview.com post).
-
ControlPoint Security Manager Application [Applications -> Dell Application: ControlPoint Security Manager]
Software to integrate the fingerprint reader into system security, both on boot as well as Windows login. As mentioned previously, after trying the software in a previous install and finding that it slows the system down, I opted out of installing it.
-
ControlPoint Connection Manager [Applications -> Dell Application: ControlPoint Connection Manager]
Manages wireless connection profiles. Unnecessary in my opinion since the Intel WiFi 5100 software comes with Intel’s connection manager.
-
Wireless Network Card [Network -> Intel Driver: Intel(R) WiFi Link 5100]
This contains both the Intel wireless card driver as well as the connection manager.
-
Touchpad / Pointing Stick [Input Device Drivers -> Dell Driver: Touchpad/Pointing Stick]
Driver for the touchpad and pointing stick. Not absolutely necessary, but enables things like the horizontal and vertical scrolls and is highly recommended.
-
Webcam Driver [Input Device Drivers -> Creative Labs Driver: Integrated Webcam]
-
Webcam Application [Applications -> Dell Application: Webcam Software]
Dell’s webcam application that allows you to capture photos and video. Note that this is not a stand-alone file, and requires that the original software be installed from the disc that should have come with your e6400. Considering there are better alternatives out there like webcamXP, I also passed on this.
Install any Windows Updates that are needed afterwards, a firewall and antivirus, and any other applications you choose. Another piece of recommended software is i8kfanGUI, a Dell-specific utility that allows you to monitor laptop temperatures and fan speeds, as well as giving you control over the fans.
This last step of installing FS-Driver/Ext2 IFS to mount your Ubuntu partitions can only be done after Ubuntu has been installed, but I’ll make mention of it here to keep things together. After installing FS-Driver, follow these setup instructions at the official site. If you’ve already set up the partition properly with 128 byte inodes, there should be no issues with mounting the Ubuntu partitions. If you do run into errors, run the diagnostics program by following the troubleshooting guide.