
Installation
|
125
You should see the word testing on the screen. Your Apache server is running with
no access restrictions, serving any files and directories that exist under /var/www.
PHP
PHP is the most popular Apache CGI module. In this chapter, we’ll use PHP 4,
which remains more popular than its eventual successor, PHP 5. Using either ver-
sion is a good way to create dynamic web pages, and the large library of PHP mod-
ules adds many useful functions. Begin by getting the PHP program and libraries:
# apt-get install php4
Now get the PHP Apache module, mod_php. This command will install mod_php
and tell Apache to let it execute files with a .php suffix:
# apt-get install libapache2-mod-php4
Create this test PHP script and save it to /var/www/info.php:
<?php
phpinfo( );
?>
Then enter the script’s URL (http://server1.centralsoft.org/info.php) in your browser.
You should see a page with tables full of PHP configuration information. This infor-
mation tells a lot about your machine that you may not want to share with the
world, so you should delete this script after testing it. If you don’t see anything, take
a look at the“Troubleshooting” section at the end of this chapter.
By the way, if you’re a newbie, you just wrote your first CGI script! (In the later sec-
tion on CGI, we’ll provide more details about how web servers run external pro-
grams and scripts.)
MySQL
If you don’t need a database, you