Understanding Apache Administration

 < 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 Apache

If 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.

TIP

If you are not connected directly to the Internet and want to view an Apache-served website on your local computer, you can refer to your local machine as localhost, 127.0.0.1, or <machine name>.local your Bonjour hostname.


Exploring the Advantages of a Fully Configured Apache Server

For 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:

  • Access Control Easily password-protect portions of your site, or restrict resource access to specific hosts on or off of your local network.

  • Virtual Hosts Your computer can host multiple websites using multiple names. You could, for example, run your personal website from www.myamazingwebpages.com while a business-only site chugs along at www.myamazinglyprofitablebusiness.com.

  • Load Limits You can control the number of Apache processes available to service incoming requests just by changing a few numbers. Therefore, you can easily increase or decrease the resources Apache consumes.

  • Web Applications Apache supports web applications running from a number of development platforms; these capabilities are deactivated by default.

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.

NOTE

I don't mean to imply that the modules included in this chapter are inherently dangerous. "Less is better" is always a good rule of thumb, whether you're talking about Apache modules or full-blown server applications.


Activating Apache

To 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 > 


    Mac OS X Tiger Unleashed
    Mac OS X Tiger Unleashed
    ISBN: 0672327465
    EAN: 2147483647
    Year: 2005
    Pages: 251

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net