DevShed - Setting Up Database Driven Websites
★ wanayoo — archive 1999 http://devshed.com/Server_Side/Administration/Database/page4.htmlNouvelle recherche | Portail wanayoo

Developer Shed
Tuesday, 10.12.99  

HOME > SERVER SIDE > ADMINISTRATION > ARTICLE    SOURCE

Power Search
Free Newsletter:


Client Side
DHTML
Graphics
JavaScript

Server Side
Administration
ASP
JServ
MySQL
PHP
Python
Roxen
Zend
Zope
Web Hosting

Tools
HTML Editors
Graphic Editors
FTP Programs

Dev Talk
Forums
Mailing List
Brain Dump
Feedback

ClipScripts
Add script
Edit script


Advertise
on DevShed
JUMP TO:
> Introduction
> Requirements
> Installing MySQL
> Installing Apache
> Installing PHP
> Creating the Database
> Making a PHP Script
> Testing the Script
Setting Up Database Driven Websites
By Ying Zhang
May 20, 1999

Installing Apache

Now we will install Apache. Assuming you downloaded it into /tmp, do the following (note you probably shouldn't be root while doing this):


$ cd /tmp $ tar -zvxf apache_1.3.6.tar.gz $ cd apache_1.3.6 $ ./configure --sysconfdir=/etc/httpd --datadir=/home/httpd --logfiledir=/var/log/httpd --enable-module=most --enable-shared=max --disable-rule=WANTHSREGEX

This tells Apache to store it's configuration files in /etc/httpd. The data files directories (HTML documents, CGI-BIN directory) will be rooted in /home/httpd. Next, we tell Apache we want most of the modules enabled, and that they should be built as DSO modules.

DSO stands for Dynamic Shared Object. By compiling Apache with DSO support, you are able to add and remove modules from Apache without having to recompile it. This is really handy, read all about it at the Apache DSO page (http://www.apache.org/docs/dso.html), if you're interested.

Next thing to do is to compile this thing. Do this by running make:


$ make

That should take a little while. When it finishes, you'll have to su to root to copy the files to their final destinations:


$ su # make install

If all goes well, you should see a bunch of messages tell you some information about Apache and how it was installed on your computer.

Configuring Apache

Starting from Apache 1.3.4, the three configuration files: srm.conf, httpd.conf, and access.conf have been consolidated into httpd.conf. Naturally, this carries on to 1.3.6, so load it into your favorite editor and change these directives:


Port 80 DirectoryIndex index.html index.shtml index.cgi index.php3 AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .phps

Scan through the files and change any other directives that you feel should be changed. For detailed information about the directives, visit the Apache Website and look at the server documentation.

Testing Apache

Run this to start Apache:


# /usr/local/bin/apachectl start

If it said that Apache was started, you should be able to use any web browser to connect to your box. If all goes well, you will see a Welcome to Apache page. Also, check that the httpd processes are running:


# ps ax | grep httpd

or


# ps -ef | grep httpd

depending on your flavour of Unix. You should see a bunch of processes like:


14362 ? S 0:00 /usr/local/apache/bin/httpd 14364 ? S 0:00 /usr/local/apache/bin/httpd 14365 ? S 0:00 /usr/local/apache/bin/httpd 14366 ? S 0:00 /usr/local/apache/bin/httpd 14367 ? S 0:00 /usr/local/apache/bin/httpd 14368 ? S 0:00 /usr/local/apache/bin/httpd

Now let's turn off Apache and install PHP.


# /usr/local/bin/apachectl stop

As with MySQL, you probably want to add an entry in one of your system startup files to fire up Apache when your system boots up.



Click here to discuss this article
with other readers
. 81 comments.


Click here to receive updates on the latest articles.




Printer friendly versionPrinter friendly version

Tech News:
• Toshiba Ships Equium Corporate Computers
• NetAid Concert Sets Traffic Records
• Microsoft Hires Ask Jeeves Online Butler
• Intel scientist says chip limits almost reached
•  More news..

Hot Forum Topics
"frame inside transparent picture"-look (http://radio.af.lu.se//studion.html)
MySQL passwords in PHP scripts
check for the uniqueness of an entry !?
Change Password using perl
PHP Hosting < $15



Copyright © 1997-99 ngenuity. All rights reserved. Privacy Policy.