Subdomains auf dem Laptop ohne Schmerzen

Auf meinem MacBook habe ich den Apache Webserver laufen1. Das an und für sich ist ja auch gar nichts schlimmes. Ich neige jedoch dazu, häufiger mal Dinge lokal auszuprobieren. Die Dinge die ich ausprobiere, sind dann immer hübsch ordentlich unter ~/Sites/webapp_a oder ~/Sites/wordpress_test_b, aber auf jeden Fall unterhalb des Site-Ordners in meinem Home-Verzeichnis.

Diese Ordner sind dann über etwas krude URLs wie http://localhost/~dennis/webapp_a/ mit dem Browser zu erreichen. Das ist erstens doof zu tippen und zweitens auch ein Problem, wenn man Dinge testen möchte, die darauf beruhen, eben nicht in einem Unterordner einer Site zu wohnen.

Das führte dazu, dass viel an /etc/hosts und dem DocumentRoot-Parameter der apache.conf rumgebaut wurde. Das macht mit zunehmender Ordner-Anzahl immer weniger Spaß.

Glücklicherweise gibt es aber Leute wie Sean Behan und Tim Pope die je eine Domain im DNS auf 127.0.0.1 auflösen lassen.

Das wiederum führt dazu, dass man seinen eigenen Computer unter http://smackaho.st/ und http://hexxie.com/ erreichen kann. Und da die beiden auch noch die Auflösung für *.hexxie.com und *.smackaho.st auf localhost zeigen lassen, kann man mit einer kleinen Anpassung der Apache-Config beliebige Subdomains auf dem eigenen Computer in beliebigen Verzeichnissen unter ~/Sites/ laufen lassen.

Einfach das hier in die Config einbauen2, den Apache neustarten und schon ist das Leben ein wenig leichter geworden:

<VirtualHost *:80>
    VirtualDocumentRoot /Users/dennis/Sites/%1
    ServerName automated_domains
    ServerAlias *.hexxie.com
</VirtualHost>

Nun sind die obigen Beispiele unter http://webapp_a.hexxie.com und http://wordpress_test_b.hexxie.com zu erreichen. Einfach, elegant und äusserst praktisch.

(via: Kristóf Kovács)


  1. Der ist bei jedem Mac dabei, einfach das Web-Sharing einschalten. Total gut. 

  2. Den Pfad natürlich anpassen… 

QuickLinks vom 8. April bis zum 30. April

Meine pinboard.in-Links vom 8. April bis zum 30. April:

  • flickrtouchr – A Python script to grab all your photos from Flickr and dump them into a directory, organized into folders by set name.
  • Scrup – Take a screenshot in OS X and have a URL to the picture in your pasteboard a second later.
  • SuprSetr – Advanced, cross-platform set management for your Flickr photosets.
  • MediathekView – durchsucht die Online-Mediatheken verschiedener Sender lädt Beiträge mit einem Programm eigener Wahl und kann Themen als Abos anlegen und neue Beiträge automatisch herunterladen
  • LSCOLORS Generator – Color generator for ls with preview
  • DVCS-Autosync – A personal Dropbox replacement based on Git
  • PasTmon – is a passive network traffic analyser that can measure user transaction response times of web, ftp, dns, irc, pop, mail, postgresql, and mysql database servers. You can even define your own signature rules to monitor custom TCP based applications.
  • Enso Launcher – is designed to give you instant access to your applications and windows. With a few easily remembered keystrokes, you can launch an application, switch to a window by name, and control the state of your windows.
  • Cntlm – is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world.

QuickLinks vom 25. August bis zum 31. August

Meine delicious.com-Links vom 25. August bis zum 31. August:

  • sshuttle – Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin access.
  • mNote – for Android is a fast notepad for Android allowing for offline local note editing, managment, and searching. In addition, mNote synchronizes with Simplenote
  • Dirpy – is an advanced DVR for your favorite online media. For example, use Dirpy to record your favorite YouTube videos to mp3s!
  • Git for the lazy – This guide is for people who want to jump to any point in time with their project/game/whatever, and want something to use for themselves.
  • DiG HOWTO – How to use dig to query DNS name servers
  • 100 Free High Quality WordPress Themes: 2010 Edition
  • PosteRazor – The PosteRazor cuts a raster image into pieces which can afterwards be printed out and assembled to a poster.
  • Soulver – It's quicker to use than a spreadsheet, and smarter and clearer than a traditional calculator.

QuickLinks vom 26. April bis zum 12. Mai

Meine delicious.com-Links vom 26. April bis zum 12. Mai:

  • latex-lab – is an open source implementation of a web based LaTeX editor for Google Docs.
  • adsf – A Dead Simple Fileserver is a tiny web server that you can launch instantly in any directory.
  • NConf – NConf is a PHP based web-tool for configuring the Nagios monitoring software. It differs from similar tools by offering enterprise-class features like templates, dependencies and the ability to configure a large-scale, distributed Nagios server topology.
  • 3-2-1 – is a countdown timer for Dashboard (OS X). It displays hours, minutes, and seconds, includes a lap function and is resizable
  • 60 Minimal Apple Desktop Wallpapers
  • Driver Easy – Auto-Detect & Download your Hardware Drivers, Quickly & Easily.
  • Analyzing I/O performance in Linux
  • ifconfig.me – Get your current external IP via curl ifconfig.me
  • The Ultimate WordPress Security Guide
  • Gas Mask – is simple hosts file manager for Mac OS X Leopard. It enables to edit hosts files and switch between them.

QuickLinks vom 9. Juli bis zum 13. Juli

Meine delicious.com-Links vom 9. Juli bis zum 13. Juli:

QuickLinks vom 2. Mai bis zum 6. Mai

Meine delicious.com-Links vom 2. Mai bis zum 6. Mai:

QuickLinks vom 24. November bis zum 28. November

Meine delicious.com-Links vom 24. November bis zum 28. November:

QuickLinks vom 09. Oktober bis zum 13. Oktober

Meine delicious.com-Links vom 09. Oktober bis zum 13. Oktober:

  • http://☃.net/ – ☃
  • TextMate Basics Tutorial – After having setup your TextMate, this Tutorial will show you around the basic features of TextMate. This is a must for everyone who wants to use TextMate seriously.
  • Ruby's Ambition – is a framework for writing adapters. Adapters are RubyGems which depend on the ambition gem and are named something along the lines of ambitious-activerecord. They typically use Ambition to turn plain jane Ruby into some sort of domain specific query which can be executed.
  • Swirly MMS – MMS Application for jailbroken iPhones… Pricetag: 8 $.
  • Subscribe2 Plugin – declares itself the beste WordPress email subscription plugin…
  • Shoes – Information and tutorials on the Shoes GUI toolkit for Ruby.
  • The Credit Crisis and the Bailout in Plain English
  • Rosetta Stone for Unix – What do they call that in this world?
  • Animated Knots by Grog – Learn a hellofalot knots…
  • fruux – is a lightweight and convenient system preference pane, that syncs your Address Book, Calendars, Tasks and Bookmarks between different Macs.
  • OSSIM – stands for Open Source Security Information Management. Its goal is to provide a comprehensive compilation of tools which, when working together, grant a network/security administrator with detailed view over each and every aspect of his networks/hosts/physical access devices/server/etc…
  • Sauron – is a scalable system for management of DNS & DHCP services

QuickLinks vom 19. September bis zum 23. September

Meine delicious.com-Links vom 19. September bis zum 23. September:

  • iGenres – Using this application you can easily change pictures that represent musical genres in new iTunes 8 grid view.
  • Build Ajax-based Web sites with PHP – Learn the process of writing Asynchronous JavaScript + XML (Ajax) applications using native JavaScript™ code and PHP. This article introduces a few different frameworks and application program interfaces (APIs) that reduce the amount of code you need to write to achieve a complete Ajax-based Web application.
  • WordPress Developer’s Toolbox – This post provides all kinds of WordPress-related resources to do just that.
  • Network Naming Schemes – Good names for nodes of any kind…
  • Diagnose Boreout
  • Top 12 Stunning WordPress Theme
  • iSquint – s an iPod video conversion app for Mac OS X. It's many times faster than QuickTime Pro, works with almost all popular video formats, and it's infinitely free-er.
  • SlideRocket – is a rich internet application that provides for every part of the presentation lifecycle. It integrates authoring, asset management, delivery and analytics tools into a single hosted environment that allows you to quickly create stunning presentations, intelligently manage your assets, securely share your slides, and measure the results.
  • Eoin Colfer to write sixth Hitchhiker's Guide book – Yay!
  • contacts – gives you access to view and search all your records in the AddressBook database from the shell.

Server-Umzug leicht gemacht mit mod_rewrite

Chris hatte gefragt inwiefern sich so ein Server-Umzug auf die Besucherzahlen auswirkt.

Ich muss sagen dass ich sehr zufrieden bin. Mein Blog hatte eigentlich nie soo viele Besucher, aber wie es ausschaut sind die 100 Leute die hier früher täglich reinschauten jetzt auch wieder da. Das finde ich gut, ihr seid herzlich willkommen.

analytics-umzugs-auszug

Man kann das Tal der DNS-Umstellung sehr gut erkennen und auch, dass in der Zeit vor dem Umzug, vermutlich wegen ständiger QuickLinks-Postings, immer weniger Besucher kamen.

Am wichtigsten für die schnelle Regeneration waren sicherlich die URL-Umleitungen von den alten Typo-Links auf die neuen WordPress-Links per mod_rewrite. So muss sich keine Suchmaschine eine neue URL merken, User müssen ihre Feeds nicht umstellen und instant-thinking.de erhält Besucher über die alten Suchmaschineneinträge.

Wer also einen Server-Umzug und/oder einen Wechsel des CMS vor sich hat, sollte auf jeden Fall an diese Umleitungen denken. Und wer von typo zu WordPress wechselt, kann hier meine Regeln (bei denen das mod_rewrite Cheat Sheet sehr geholfen hat) abschreiben:

Rule to transfer the old (Typo-Style)Image-Requests to their new Home:

RewriteRule ^files/(.*)$ /wp-content/uploads/2007/09/$1 [R=301,L]

Rule to get rid of the old article-element in the URLs:

RewriteRule ^articles/(.*)$ /$1 [R=301,L]

Get the old Feed URLs on Track:

Site-Feeds:

RewriteRule ^xml/rss/feed.xml$ /feed/ [R=301,L] RewriteRule ^xml/atom/feed.xml$ /feed/ [R=301,L]

Comment-Feed:

RewriteRule ^xml/rss20/comments/feed.xml$ /comments/feed/ [R=301,L]

Ich habe die ganzen alten Grafik-Dateien in den /wp-content/uploads/2007/09/ Ordner geworfen und Requests auf die alten Orte dahin umgeleitet, neuere Uploads werden von WordPress ja automatisch passend sortiert hochgeladen.

Etwas hässlich ist, dass der Atom-Feed auf den RSS-Feed umgeleitet wird, aber ich denke das werden aktuelle Feed-Reader schon verpacken…

Always remember kids, cool URIs don´t change!