- Shopping Bag ( 0 items )
The big day is Monday. The day you get to show off what you know about Apache Web server, MySQL database, and PHP scripting. The problem is, you're not really up to speed. Maybe it's been a while since you installed all three of these technologies. Perhaps you've never used Apache, MySQL, and PHP together. Or maybe you just like a challenge. In any event, we've got a solution for you - Apache, MySQL, and PHP Weekend Crash...
Ships from: BAY SHORE, NY
Usually ships in 1-2 business days
Ships from: fallbrook, CA
Usually ships in 1-2 business days
Ships from: acton, MA
Usually ships in 1-2 business days
The big day is Monday. The day you get to show off what you know about Apache Web server, MySQL database, and PHP scripting. The problem is, you're not really up to speed. Maybe it's been a while since you installed all three of these technologies. Perhaps you've never used Apache, MySQL, and PHP together. Or maybe you just like a challenge. In any event, we've got a solution for you - Apache, MySQL, and PHP Weekend Crash Course. Open the book Friday evening and on Sunday afternoon, after completing 30 fast, focused sessions, you'll be able to dive right in and begin building dynamic, data-driven sites on either Windows or Linux with all three integrated technologies.
Evening: 4 Sessions, 2 Hours
* Installing Apache
* Installing PHP
* Installing MySQL
* Apache Basics
Morning: 6 Sessions, 3 Hours
* Configuring Apache
* Apache Security Concerns
* The Basics of MySQL
* MySQL Security
* Working with Data
Afternoon: 6 Sessions, 3 Hours
* Troubleshooting MySQL Commands and Queries
* Advanced MySQL Concepts
* PHP Basics
* Program Flow
* PHP Functions
Evening: 4 Sessions, 2 Hours
* Working with Files
* HTML Constructs
* Working with Forms
* Multiple-User Considerations in PHP
Morning: 6 Sessions, 3 Hours
* Good Coding Practices
* Debugging and Troubleshooting PHP
* MySQL Through PHP
* Debugging and Troubleshooting MySQL in PHP
* Odds and Ends
* Project: Calendar I
Afternoon: 4 Sessions, 2 Hours
* Project: Calendar II
* Project: Content Publishing I
* Project: Content Publishing II
* Project: Building an RSS Feed
Part I—Friday Evening.
Session 1–Installing Apache.
Session 2–Installing PHP.
Session 3–Installing MySQL.
Session 4–Apache Basics.
Part II—Saturday Morning.
Session 5–Configuring Apache.
Session 6–Apache Security Concerns.
Session 7–The Basics of MySQL.
Session 8–MySQL Security.
Session 9–Working with Data.
Part III—Saturday Afternoon.
Session 11–Troubleshooting MySQL Commands and Queries.
Session 12–Advanced MySQL Concepts.
Session 13–Getting Ready to Use PHP.
Session 14–PHP Basics.
Session 15–Program Flow.
Session 16–PHP Functions.
Part IV—Saturday Evening.
Session 17–Working with Files.
Session 18–HTML Constructs.
Session 19–Working with Forms.
Session 20–Multiple-User Considerations in PHP.
Part V—Sunday Morning.
Session 21–Good Coding Practices.
Session 22–Debugging and Troubleshooting PHP.
Session 23–MySQL Through PHP.
Session 24–Debugging and Troubleshooting MySQL in PHP.
Session 25–Odds and Ends.
Session 26–Project: Calendar I.
Part VI—Sunday Afternoon.
Session 27–Project: Calendar II.
Session 28–Project: Content Publishing I.
Session 29–Project: Content Publishing II.
Session 30–Project: Building an RSS Feed.
Appendix A–Answers to Part Review Questions.
Appendix B–What’s on the Companion Web Site.
This book shows you how to knit together Web server, database server, and scripting technologies. These three technologies enable you to deliver powerful and dynamic content via the Web. Before you can begin using the technologies, you need to install all three components, starting with the Apache Web server. These first three sessions walk you though the process of installing the technologies, testing each, and testing their interactions to ensure that you are ready to start working with each.
Why Use Apache?
Apache powers the Web. Although this seems a grandiose claim, there is a lot of truth to it. Recent surveys show that an overwhelming number of Web sites run Apache as their Web server. That being the case, why do all these Web sites use Apache?
Apache is free.
Apache is open source.
Apache is cross-platform.
Apache is continually undergoing rapid development.
Apache is powerful, yet modular.
Apache Is Free
Apache is a full-featured, powerful Web server available absolutely free. Because the Apache Software Foundation is not deriving revenue from the Apacheserver, however, it cannot afford to offer robust technical support. Amenities such as phone or online support are not included with Apache. Abundant documentation is available, but support at the level you may be used to with commercial software is not.
Apache Is Open Source
You can get the source code for Apache and modify it to your heart's content. Most people don't use the source code to modify how Apache works; they use it to modify how Apache is built-that is, what options are compiled into the server. If you need a mean, lean server, you can recompile the source code to create a custom server with only the options you need. That said, if you ever find a problem or need to make a rudimentary change to the Apache source code, you can.
The concept of open source software is not new, but the idea can be rather intricate. For more information on Open Source software, visit GNU.org and read the various licenses: gnu.org/licenses/licenses.html.
Apache Is Cross-Platform
Apache is available for multiple platforms, including the following:
Windows (9x through XP, although server versions-NT/2000-are preferred)
Mac OS X (BSD under the GUI)
Besides a few minute details, such as the placement of its files in the file system, Apache operates the same on all of the aforementioned platforms.
Apache Is Continually Undergoing Rapid Development
Apache is maintained by the Apache Software Foundation and is under continual development and improvement. Bug and security fixes take only days to find and correct, making Apache the most stable and secure Web server available.
The relative stability and security of any Web server depends on the system administrator as much as, if not more than, the underlying software.
Another advantage of rapid development and releases is the robust feature set. New Internet technologies can be deployed in Apache much more quickly than in other Web servers.
Apache gets its name from the way it was originally developed. Originally, the server was made of several components or "patches," making it "a patchy server."
Apache continues to implement its features with distinct pieces, or modules. Utilizing a modular approach to feature implementation enables Apache to be deployed with only the amount of overhead necessary for the features you want. It also facilitates third parties developing their own modules to support their own technologies.
Apache supports almost all Internet Web technologies, including proprietary solutions such as Microsoft's FrontPage Extensions. Apache supports all manner of HTTP protocols, scripting, authentication, and platform integration.
Visit the Apache module Web site (http://modules.apache.org) for information on the modules included with Apache and the registered third-party modules.
For our purposes, we care about the following capabilities:
Robust HTTP delivery
Configurable, reliable security
Integration with PHP
CGI and other scripting integration
Gathering Required Materials
Everything that you need to install Apache can be found at the Apache Web site, at apache.org. You can download the source and/or binary files for Unix/Linux installations or a binary install package for Windows. The main Apache.org Web site is shown in Figure 1-1.
Apache is also packaged for most Linux distributions. For example, Red Hat maintains an Apache Red Hat Package Manager (RPM), which can be used to install Apache on a Red Hat system. If you don't need the absolute latest version of Apache and don't need it configured a particular way, it is worth visiting the Web site for your distribution to download an appropriate Apache package.
The Apache Software Foundation maintains several different projects-the HTTP Server Project being the most prominent. The main page for the HTTP server can be found at http://httpd.apache.org. Various links from this page lead to source and binary code downloads, documentation, and other resources. The main HTTP Server Project page is shown in Figure 1-2.
At the time of this writing, the current Apache server version is 126.96.36.199.
Documentation on Apache is also available from the Apache Web site. Downloading the PDF version of the documentation for later use is worth the time.
At the time of this writing, the PHP project is still issuing warnings about using PHP 4.x on Apache 2.0 in a production environment. Although I've not seen any issues combining the two, a warning from the project should not be taken lightly. If you are going to use PHP and Apache in a production environment, you might want to consider running Apache 1.3.x instead of Apache 2.0.x.
Windows Downloads Windows users should follow the download links to the Windows binary install (currently available as an MSI Installer-a special program for installing packages on Windows). Download this file to a temporary folder on your local hard drive.
If you need a specially compiled version of Apache, the source files for the Windows version are also available. You need to have a suitable C++ compiler installed-Microsoft C++ version 5.0 or later is recommended. Other tools and special configuration options are also necessary to compile Apache. You can find additional information on compiling Apache for Windows at http://httpd.apache.org/docs-2.0/platform/win_compiling.html. This session covers installation of the Windows binaries only.
Many methods for installing Apache on Linux are available; the method that you choose depends on your answers to the following questions:
What distribution of Linux are you running?
Does your distribution have a package with a recent version of Apache? Do you need to compile your own version for compatibility or capability reasons?
If you are running one of the major Linux distributions (Red Hat, Mandrake, United Linux, Debian, and so on), chances are good that a recent copy of Apache is packaged for your distribution. A recent installation of Red Hat 8.0, for example, contains Apache version 2.0.40 release 8 on CD #2 in RPM form (httpd-2.0.40-8.i386.rpm). After installation, you can use the Red Hat Update Agent to update Apache to 2.0.40 release 11, the latest version of Apache packaged for Red Hat.
If your Linux version does not have a recent version of Apache packaged, you can download the generic binary version for installation on your system. An Other files link is available from the Download page on the Apache HTTP Server Web site. Follow the resulting links (starting with _binaries_) to identify and download the version that most closely matches your distribution and configuration. If you are using Red Hat version 7.3 on a Pentium III or IV processor, for example, you want to download the following file:
Download and read the README file associated with the archive before you download and install the archive. The README file contains the options the binary was compiled with. (Notice that the term archive, as used here and throughout this book, evolves from the Unix world, where archives of collections of files were written to magnetic tape. The utility tar stands for Tape ARrchive. Today, it simply means a collection of files bundled together for a particular purpose.)
If you need a specially compiled version of Apache, you can download the source and compile Apache yourself.
Despite the fact that Apache is a full-featured HTTP server, installing it is actually as simple as installing a regular application. Because it is a server, you face many implications on system security after Apache is installed. Security issues are covered in depth in Session 5.
Installing Apache on Windows
If you are installing Apache on Linux, you can skip this section and move on to the section "Installing Apache on Linux from Packages," later in this session.
To install Apache on Windows, you need to download the Windows binary installer, as covered in the section "Windows Downloads," earlier in this session. This file is usually named as follows:
The asterisk (*) indicates the minor version number. At the time of this writing, the minor version is 45.
Although you can run Apache on Windows 9x/Me, doing so is not advised. Windows NT/2000/XP provides a substantially more stable and secure base for any server application. The following instructions were performed on a copy of Windows 2000 Professional.
Place this file in a temporary directory and follow these steps to install Apache:
1. Log into Windows as an Administrator.
2. Use Windows Explorer to locate the file on your hard drive, as shown in Figure 1-3.
3. Double-click the installer to begin the installation.
4. The Apache installer performs like many other Windows installers, using a Wizardlike approach, as shown in Figure 1-4.
5. Click the Next button, read and confirm your acceptance of the license agreement, and click Next again.
6. The next Wizard window displays useful information about running Apache on Windows for anyone new to the process. Read it before clicking Next.
7. The next window enables you to specify server information. This information should be populated from information already present in Windows, as shown in Figure 1-5. The information should be okay as is; review it before clicking Next. If necessary, modify the information to suit your needs.
If you need to edit the dialog box, set the Network Domain field to the name of your domain. In this case, you are running Apache on an internal network, so you specify .local as your top-level domain instead of a .com, .org, or other top-level domain. The Server Name field should be the machine name (or www), complete with the fully qualified domain information. The last option enables you to control how the server is run. You're best off accepting the default, for All Users, on Port 80, as a Service-Recommended. Click Next after the settings are complete.
This information can be changed later by editing the Apache configuration files.
8. The next window enables you to select to install Apache in the typical location with the typical components, or specify a custom installation. The typical installation installs Apache in the directory C:\Program Files\Apache Group. (The drive letter may vary, depending on your individual installation.) The typical installation installs the Apache binary files and documentation but not the headers and libraries. You should select the typical installation unless you need to change any of these settings. Click Next to continue the installation.
9. You are given a chance to change the default directory where Apache is installed. Accept the default by clicking Next.
10. A confirmation window gives you one more chance to correct any installation options. Click Back to change any options or Install to begin the installation.
11. After the installation completes, a completion window is displayed. Click Finish to end the installation program.
After Apache is installed, the server starts automatically. You can verify that the server is running by checking the Apache Service Monitor icon in the system tray, as shown in Figure 1-6.
If the icon has a green arrow, the server is running. If the server is not running, a red dot replaces the arrow. You can double-click the icon to display the Apache Service Monitor. Using this monitor is covered in Session 4.
Unless you also need to install Apache for Linux, you can skip the next section and resume at the section "Testing the Installation," later in this session.
Building and Installing Apache for Linux (from Source)
If you need to compile Apache, you need an appropriate source archive. You can download one of the standard archives from Apache.org or obtain one from your distribution vendor. This session covers compiling from the source files on Apache.org. If you have a binary archive or package to install, you can skip this section.
The source files are available from the Apache HTTP server download page as a gzipped tarball or a compressed tarball. Download the appropriate file into a temporary directory or the typical location for source files on your system (usually /usr/src).
Tarball is a common name for an archive packaged with the tar utility and is a common means of distributing software, much like ZIP files are used for Windows. In their raw form, tarballs do not incorporate compression; they must be compressed by using special tools such as gzip or by using the compress options in the tar utility.
You can use several methods to unpack the source files; the methods available depend on the utilities you have installed and the file you downloaded.
Excerpted from Apache, MySQL, and PHP Weekend Crash Course by Steven M. Schafer Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.