 |
|
Oracle Database Tips by Donald Burleson
|
Installing Apache on Linux
To install the Apache
server on a Linux box, first download the source from the
http://www.apache.org site. The
download link looks like this:
Of course, as versions have changed since this
book was written, you should download the version that best fits your
purpose. In this case, we will download file httpd-2.0.53.tar.gz which
contains the UNIX source file compressed by the gzip compression
program. The file is approximately 6.5 MB long. When the download is
complete, unpack the file using the following command:
tar -zxvf
httpd-2.0.53.tar.gz
This command creates the directory, httpd-2.0.53,
and unpacks the source file into that directory. The contents of the
directory looks like this:
$ cd
httpd-2.0.53
$ ls
ABOUT_APACHE CHANGES InstallBin.dsp os
acconfig.h config.layout LAYOUT README
acinclude.m4 configure libhttpd.dsp README.platforms
Apache.dsp configure.in LICENSE server
Apache.dsw docs Makefile.in srclib
apachenw.mcp.zip emacs-style Makefile.win support
build httpd.spec modules test
BuildBin.dsp include NOTICE VERSIONING
buildconf INSTALL NWGNUmakefile
The most important file in this directory is the
"configure" file. To continue this process, the development tools, the
primarily C compiler and the development libraries must be installed.
Some Linux distributions, most notably SuSE 9.x, come without
development tools installed. These tools must be present in order to
proceed. If the tools are present, run the configure script noted
below:
./configure
--prefix=/opt/apache
This script configures Apache2 for installation
into the /opt/apache directory. Without the –prefix argument, Apache
will be installed into /usr/local directory. The list of all available
options is shown when ./configure --help is executed. Here is
the output of the typical ./configure script:
$ ./configure
--prefix=/opt/apache
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
Configuring Apache Portable Runtime library ...
checking for
APR... reconfig
configuring package in srclib/apr now
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
Configuring APR library
Platform: i686-pc-linux-gnu
checking for working mkdir -p... yes
APR Version: 0.9.6
checking for chosen layout... apr
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
The checking goes on and on. When the script is
finished, it creates a file named "Makefile". If any error is
encountered, the script will fail and the Makefile file will not be
created. Makefile is used as input to the program called "make"; one
of the development tools that must be installed on the system.
After the "Makefile" file is created, execute
"make" using the following command:
make
This command compiles all the source files of the
Apache server. The result looks like this:
/tmp/httpd-2.0.53/srclib/apr/libtool
--silent --mode=compile gcc -g -O2 -pthread -DLINUX=2 -D_REENTRANT
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER
-I/tmp/httpd-2.0.53/srclib/apr/include -I/tmp/httpd-2.0.53/srclib/apr-util/include
-I. -I/tmp/httpd-2.0.53/os/unix -I/tmp/httpd-2.0.53/server/mpm/prefork
-I/tmp/httpd-2.0.53/modules/http -I/tmp/httpd-2.0.53/modules/filters
-I/tmp/httpd-2.0.53/modules/proxy -I/tmp/httpd-2.0.53/include -I/tmp/httpd-2.0.53/modules/generators
-I/tmp/httpd-2.0.53/modules/dav/main -prefer-non-pic -static
-c modules.c && touch modules.lo
/tmp/httpd-2.0.53/srclib/apr/libtool
--silent --mode=link gcc -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER
-I/tmp/httpd-2.0.53/srclib/apr/include -I/tmp/httpd-2.0.53/srclib/apr-util/include
-I. -I/tmp/httpd-2.0.53/os/unix -I/tmp/httpd-2.0.53/server/mpm/prefork
-I/tmp/httpd-2.0.53/modules/http -I/tmp/httpd-2.0.53/modules/filters
-I/tmp/httpd-2.0.53/modules/proxy -I/tmp/httpd-2.0.53/include -I/tmp/httpd-2.0.53/modules/generators
-I/tmp/httpd-2.0.53/modules/dav/main -export-dynamic -o httpd
modules.lo modules/aaa/mod_access.la modules/aaa/mod_auth.la
modules/filters/mod_include.la modules/loggers/mod_log_config.la
modules/metadata/mod_env.la modules/metadata/mod_setenvif.la
modules/http/mod_http.la modules/http/mod_mime.la modules/generators/mod_status.la
modules/generators/mod_autoindex.la modules/generators/mod_asis.la
modules/generators/mod_cgi.la modules/mappers/mod_negotiation.la
modules/mappers/mod_dir.la modules/mappers/mod_imap.la modules/mappers/mod_actions.la
modules/mappers/mod_userdir.la modules/mappers/mod_alias.la modules/mappers/mod_so.la
server/mpm/prefork/libprefork.la server/libmain.la os/unix/libos.la /tmp/httpd-2.0.53/srclib/pcre/libpcre.la
/tmp/httpd-2.0.53/srclib/apr-util/libaprutil-0.la -lgdbm -ldb-4.2 -lexpat
/tmp/httpd-2.0.53/srclib/apr/libapr-0.la -lrt -lm -lcrypt -lnsl -lpthread
-ldl
make[1]:
Leaving directory `/tmp/httpd-2.0.53'
$
This result is executed as an ordinary user, named
"mgogala". The only prerequisite for linking Apache is access to make
gcc and all necessary libraries. The next step is installing the
Apache server. The installation is performed by executing "make
install". Root privileges are needed because normal users cannot write
to the system directories, such as /opt. The following script
accomplishes this task:
$ su - root
Password:
[root@medo ~]# mkdir /opt/apache
[root@medo ~]# cd /tmp/httpd-2.0.53
[root@medo httpd-2.0.53]# make install
This script is very verbose and puts all the files
in their proper places as well as creates the necessary
subdirectories. Apache is now installed. To verify completion, start
the server as the user "root":
/opt/apache/bin/apachectl start
If everything was successful and no errors
returned, success can be verified by visiting the default page on
http://localhost. The result should be a well known "feather" looking
like this:
This page is called a "feather" because of the
Apache logo. To install PHP, shut down the Apache server by issuing
the following command:
/opt/apache/bin/apachectl stop
Now, the installation of PHP5 can begin.
See
code depot for complete scripts
This is an excerpt from the book
Easy Oracle PHP. You can get it
for more than 30% by buying it directly from the publisher and get
instant HTML-DB scripts from the code depot:
 |
Easy Oracle PHP
Create Dynamic Web Pages with Oracle Data
Includes online HTML-DB code depot
Buy it now for 30% off
- Only $19.95
|
HTML-DB support:
 |
For HTML-DB development support just call to gat an
Oracle Certified professional for all HTML-DB development
projects. |
|