Personal Web Sharing

From Mac Guides

Jump to: navigation, search

Personal Web Sharing has been available in various forms since System 7. In Mac OS X, Apache makes Web sharing possible.

Contents

Mac OS X

Apache is a very robust, open-source Web serving platform that runs on many flavors of Unix (including OS X) as well as some versions of Windows. From the Apache HTTP Server Project site:

Apache has been the most popular web server on the Internet since April of 1996. The November 2005 Netcraft Web Server Survey found that more than 70% of the web sites on the Internet are using Apache, thus making it more widely used than all other web servers combined.

Turning on Web sharing in OS X is as easy as clicking a check box in the Sharing System Preferences pane. Files shared by OS X Web sharing exist in one of two types of locations — the system-wide site and user-specific sites.

System-wide site

Files at /Library/WebServer/Documents will, by default, be shared as the root Web site when Web sharing is turned on. These files can be accessed at http://localhost/ or http://<yourIPaddress>.

User-specific sites

Files at ~/Sites, or in your home folder's Sites folder, are considered your user-specific site files. Each user by default has one of these folders. Each user's site can be accessed at http://<yourIPaddress/~(shortusername).

Configuring Apache

Apache is extremely powerful and customizable. This customization is a bit easier in Mac OS X Server, which includes GUI tools for configuring Apache. The client version of OS X runs exactly the same Apache server, but configuration must be done completely through the editing of a text configuration file at /etc/httpd/httpd.conf.

Apache also includes support for different modules, enabling advanced features such as WebDAV and PHP.

See the Working with PHP and MySQL guide.

Classic Mac OS

Links