MacOS – Preferred Location for cgi executables in Lion Server

macosserver.appwebserver

This question relates to use of a Lion Server only for testing and prototyping, so I don't need multiple sites hosting separate domains. All of my projects have directories in the root directory, not in separate "Sites" sub-directories.

In Lion Server, Apple has dropped the previous directory arrangement of:

/Library/WebServer/CGI-Executables [aliased as cgi-bin]

/Library/WebServer/Documents [aliased as root directory]

Now, the web server is simply:

/Library/Server/Web/Data/Sites/Default

After I installed Lion Server, Apache was still configured with cgi-bin aliased to /Library/WebServer/CGI-Executables and root directory to /Library/WebServer/Documents. I changed the latter in the Web section of Lion's Server.app to /Library/Server/Web/Data/Sites/Default.

I'd like to ditch /Library/Webserver. I can't find any reference to a preferred/recommended directory for my executables. I'm thinking:
/Library/Server/Web/Data/Exec [aliased in Apache config as cgi-bin or whatever]

I'm used to having all my executables in one place, and they usually share lots of modules in common, so I'm not inclined to put a cgi directory in each project's own directory.

Suggestions? Current best practices?

Thanks.

Best Answer

OS X being an unix-based system, you may use the standard unix file structure for that.

Generally speaking, most unix/linux distros use /var/www/ for web server storage, you could imagine something like /var/www/html for pages and media and /var/www/cgi-bin for cgi executables.

There are others locations available (/srv for example), see this list on wikipedia for an explanation on the directory structure (if needed)