Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Make Apache parse regular HTML files for CGI's UNIX
If you use CGI's on your web pages (counters, etc.), then you've had to enable "shtml" processing in your httpd.conf file. Sometimes, though, you just want to stick a CGI counter on a plain boring HTML page. The standard solution is to rename the file with a .shtml extension so Apache will parse it. However, if you don't want to rename your files (as you'd then have to fix broken links from other pages), you can use the XBitHack flag in httpd.conf. Enter the following in your /etc/httpd/httpd.conf file:
XBitHack on
This directive tells Apache to treat any file that has the user-execute bit set as a server-parsed html document. So simply change the user 'execute' bit (chmod u+x filename.html) of any of the regular HTML files that you want parsed, and Apache will do the rest.

Remember to stop and restart the server for your changes to take effect. Note that I have not tried this yet on my Apache install, but this is basically right off the Apache documentation pages, so it should work as described.
  Post a comment  •  Comments (3)  
  • Currently 2.00 / 5
  You rated: 2 / 5 (2 votes cast)
[3,024 views]  View Printable Version
Useful utilities - GetFileInfo and SetFile UNIX
Stuck (almost uselessly) in /Developer/Tools/ are two rather incredible little guys you should immediately link (ln -s) right into /usr/bin/. They are GetFileInfo and SetFile.

For more on how to use these tools, including exactly how to create the links and how to hide a given volume on the desktop (for example), read the rest of this article.
read more (254 words)   Post a comment  •  Comments (5)  
  • Currently 3.00 / 5
  You rated: 3 / 5 (4 votes cast)
[26,327 views]  View Printable Version
Go to web pages from a shell UNIX
alias go "osascript -e 'open location \!:1'"

This is a neat script to put in your aliases.mine (.cshrc) file. Whenever you need to go a webpage just type go followed by the website in quotes.

go ""
  Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
[2,893 views]  View Printable Version
Use the command line to access files faster UNIX
The 'open' command from Terminal command line is like a double-click on an object, and sometimes it is much faster than using the Finder, at least for me. I've been a CLI user for decades and while I appreciate the GUI, many times it is too slow. Often the Finder requires far too many operations to get to the file or folder that I need to work on. Why 'Find' a location in the directory tree when I already know where it is?

Read the rest of this article for an interesting write-up on using the command line to improve the efficiency of the OS X GUI.
read more (243 words)   Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
[5,964 views]  View Printable Version
Offer more directories via anonymous FTP UNIX
I think I finally figured out how to use something like links or aliases in an ftp server for anonymous logins.

First up there's a link on enabling anonymous ftp here on If you haven't set up an anonymous ftp server yet, I suggest you read and follow those instructions. Furthermore I suggest you set up a FireWall for security reasons.

The problem is that for security reasons, ftp servers do not allow anonymous users to access anything outside the dedicated ftp directory e.g. /Users/ftp. Therefore, neither soft links done by "ln -s file1" nor aliases to files and especially directories outside the ftp directory will work. Hard links done by "ln file1" will work, though, but they are hardly a replacement because you can't do hard links on directories therefore you'd have to link every single file and this may take a while if e.g. you want to serve up your collection of 23,156 MP3 songs in 2,167 directories :-)

The solution is to trick the ftp server into believing that linked files are real files within the /Users/ftp directory. And that can be done by NFS, Network File System, which is also built into Mac OS X.

Read the rest of this article if you'd like a detailed how-to on setting up NFS and sharing multiple directories via FTP.

[Editor's note: I have not done this on my machine. You should be comfortable with the command line before proceeding. If you're not UNIX-savvy and have only occasional needs, check out Ben Spink's Java-based FTP server Crush.]
read more (677 words)   Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
[10,530 views]  View Printable Version
Monitor file system activity UNIX
Hard drive thrashing and you don't know why? Just curious to see what apps are doing to your hard disk behind your back? Give yourself a wide terminal window and type:
sudo fs_usage
You will get a running display of file system access. As always, "man fs_usage" for more info. This and other tools can be found in /usr/bin.
  Post a comment  •  Comments (0)  
  • Currently 4.43 / 5
  You rated: 3 / 5 (7 votes cast)
[14,160 views]  View Printable Version
Getting XDarwin running in 10.1 UNIX
/. is running a slashback ditty about users having trouble with XDarwin under 10.1. I've got it running fine, here's the gotchas.

Firstly, the general installation overview is summarized in a previous MacOSXHints article, so I won't rehash that here. Once you have xf86 4.1 and XDarwin 1.0a3 installed, minor tweakage is needed for great justice. The problem is that the xinit binary is not in the default shell's path, I fixed that at the user level by creating a .cshrc file (which belongs in your home directory: cd ~ to get there). Here's how: Obviously, use vi or whatever to create the file. For the contents, first issue this command to an open shell window:

echo $PATH

This will give you your current (and likely your default) path. Highlight the path and copy it. In your newly created .cshrc file, you need a line saying:

setenv PATH [paste default $path here]:/usr/X11R6/bin:/usr/local/X11/bin

You may also want to add a line for the man pages; the procedure is the same, but use echo $MANPATH for the default, and:

sentenv MANPATH [paste default $manpath here]:/usr/X11R6/man

(Note-it's hard to see due to the formatting, but between the copy/paste stuff and the new lines is a :, make sure it gets there)

After doing the above, I have a working XDarwin under 10.1. While you're hacking your .cshrc file, you may also want to check out another previous MacOSXHints article on ssh-see the first comment for another tasty usage of the .cshrc file... Also note-I'm sure this can be done at the system level, but don't know offhand where it's done, if anybody knows by all means post it on this thread...
  Post a comment  •  Comments (13)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
[4,520 views]  View Printable Version
Enabling PHP in 10.1 UNIX
Apple has included PHP 4.06 in OS X 10.1. Stepwise has the instructions necessary to make it functional - just uncomment the following four lines in /etc/httpd/httpd.conf:
LoadModule php4_module        libexec/httpd/
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Stepwise has a nice page of info on changes in 10.1 that covers this and other aspects of the upgrade; give it a visit to see some things to keep in mind as you upgrade.
  Post a comment  •  Comments (6)  
  • Currently 3.50 / 5
  You rated: 5 / 5 (2 votes cast)
[2,732 views]  View Printable Version
SSH 'version mismatch' error and fix in 10.1 UNIX
If you installed your own version of SSH (particulary using instructions from Stepwise) under 10.0.4, you may get an error such as this

OpenSSL version mismatch. Built against 90581f, you have 90602f

when you try to use SSH in 10.1. Stepwise has the solution in the form of a "SSHCleanup.command" shell script; click here to view the script's contents. To use it, copy and paste the text into a new text file and name it "ssh-cleanup.command". Save the file (in pure text format), then open a terminal and type sudo sh ssh-cleanup.command in the directory where you saved the file.

This should fix your SSH problems in 10.1. Thanks to Peter H. for finding both the error and the solution.
  Post a comment  •  Comments (6)  
  • Currently 2.67 / 5
  You rated: 2 / 5 (3 votes cast)
[3,641 views]  View Printable Version
Web sharing and mod_hfs in 10.1 UNIX
Some users have reported problems when they try to enable Web Sharing (which launches the Apache web server) in OS X 10.1. The issue is apparently related to the "mod_hfs_apple" file, which Apple created to work around an HFS-related security hole.

You can either disable mod_hfs until Apple fixes this (not recommended due to the security issues) or patch it, thanks to Stepwise. The disabling instructions are in the remainder of this article. To patch it, simply do the following in a terminal session:
cd /tmp
curl -O
sudo tar -xzf mod_hfs_apple.tgz -C /
Make sure you stop Apache and restart it after the change. These commands install the new mod_hfs module from the Developer Tools, which are not yet publicly released.
read more (154 words)   Post a comment  •  Comments (1)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
[3,612 views]  View Printable Version