Apache Bundle Upgrade
February 11th, 2008
The Apache bundle, which I originally contributed in the early days of TextMate, was due an upgrade. So I’ve made a few improvements…
Start, Stop, Restart and Graceful commands (⌘R)
These commands, which all target apachectl, are now bound to ⌘R under the source.apache-config scope which makes it more convenient to directly control httpd from TextMate.
As apachectl requires sudo privileges I used applescript for authentication. For reasons only known to Apple the password request dialog would launch but not get focus - leaving you to reach for the mouse to target the input field. Moving away from the keyboard is slow so this was something that really annoyed me. I’ve now switched to using the excellent tm_dialog system which makes things much smoother.
It is also possible to store your admin password in your Keychain, this is done by selecting the “Add to Keychain” toggle in the password request dialog box. I’m more than happy with the security implications of this as I’m fairly good at keeping my machines locked. If you do choose to do this then the command line security app will have access to the keychain item and is the only way someone could gain access.
Documentation (⌃H)
This now searches a documentation index file for the current word/selection then redirects or presents a list of matches as appropriate. If you appear to have the documentation installed locally then the script favours it over the apache website.
Open Include (⇧⌘D)
The language definition has been improved to add a scope for Includes. Using the key combination apple-shift-D on this scope opens the file referenced by the inlcude, or directory if it is wild carded.
Open Config… (⇧⌘C)
Previously there were various commands to open the apache.conf files these have now been consolidated into one command which searches the apache install directory, either /etc/apache2 or /private/etc/httpd depending on your version of OS X and the /users, /extra and /other subdirectories. All the conf files found are presented in pop-up from which one can be choosen to open.
Bundle Configuration
It is now possible to override the default bundle behaviour by setting the following environmental variables. TM_APACHE_DIRECTORY, TM_APACHE_ACCESS_LOG, TM_APACHE_ERROR_LOG and
TM_APACHE_MANUAL_URI all allow the custom targeting of files and directories. See the bundle help for a detailed explanation.




Leave a Reply