< Day Day Up > |
What Is Apache?Apache is an open source project developed by a worldwide group of volunteers known as The Apache Group (http://www.apache.org). It is available on dozens of operating systems, including Microsoft Windows. Apache's appeal comes from its flexibility and extensibility. The base server package excels at serving HTML, but to truly exploit the power of Apache, you can install a number of extension modules, including MP3 streaming servers, SSL security, Java Server Pages, and much more. With a total expenditure of $0, you can set up a secure e-commerce server that processes credit cards in real-time and delivers SQL database access. Differences Between Classic Web Sharing and ApacheIf you're looking for the features of the Mac OS 8/9 Personal web server, look elsewhere. The Apache server under Tiger does not offer the Finder mode, nor does it offer the SimpleText-to-HTML conversion of the early Mac OS operating systems. To place information online, you'll need to create HTML documents. This isn't difficult, but there is no direct upgrade path if you have a collection of SimpleText documents you've been serving to the Internet. Although Mac OS 8/9 enabled you to use the primary address of your computer as the address for your website, Apache forces a URL based on your username. For example, if your computer's address is http://192.168.0.1 and your username is joeuser, your website address would be http://192.168.0.1/~joeuser. This change is because of the multiuser capabilities of Tiger. Regardless of how many users are on the system, each can have his personal website online, simultaneously. To use this feature, users must place their web pages within the Sites folder of their home directory. If you want a single server without usernames, a master website can be created by placing documents in the /Library/WebServer/Documents folder.
Exploring the Advantages of a Fully Configured Apache ServerFor many users, simply turning on Apache might be sufficient for their web serving needs. There is nothing wrong with working within the Apple default settings, but there are a number of advanced features that can be quickly unlocked just by tweaking a few lines. For example:
In addition to the base features of Apache, there are also add-ons that will transform your system into a web-serving powerhouse. Literally hundreds of Apache modules are available for download (http://modules.apache.org/), so we'll look at select few. If you're not interested in these features, take a look at the other Apache modules available. It's best to install only the modules you really use. Additional modules can add overhead and potentially weaken the overall security of the server.
Activating ApacheTo activate Apache, open the System Preferences application (path: /Applications/System Preferences) and click the Sharing icon. You've seen the screen shown in Figure 23.1 before. Figure 23.1. Use the Sharing Preference panel to activate Apache.With the Services button selected, highlight the Personal Web Sharing line. Assuming that the screen reads Web Sharing Off, click the Start button to start Apache. After a few seconds, the server status should change to Personal Web Sharing On. Your web pages are now online at the URL located at the bottom of the pane. The Sharing button does two things. First, it configures Tiger to start Apache when it boots. The /etc/hostconfig file is modified to read WEBSERVER=-YES-: ## # /etc/hostconfig ## # This file is maintained by the system control panels ## # Network configuration HOSTNAME=-AUTOMATIC- ROUTER=-AUTOMATIC- # Services ... MAILSERVER=-AUTOMATIC- NETINFOSERVER=-AUTOMATIC- NFSLOCKS=-AUTOMATIC- NISDOMAIN=-NO- RPCSERVER=-AUTOMATIC- TIMESYNC=-YES- QTSSERVER=-NO- WEBSERVER=-YES- ... Second, it activates the Apache server with no need to reboot. You should immediately be able to bring up the default website for your computer and your user account. |
< Day Day Up > |