397 lines
18 KiB
HTML
397 lines
18 KiB
HTML
<!--startcut ==============================================-->
|
|
<!-- *** BEGIN HTML header *** -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML><HEAD>
|
|
<title>Mark's Web/Database Installation LG #57</title>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
|
|
ALINK="#FF0000">
|
|
<!-- *** END HTML header *** -->
|
|
|
|
<CENTER>
|
|
<A HREF="http://www.linuxgazette.com/">
|
|
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.jpg"
|
|
WIDTH="600" HEIGHT="124" border="0"></H1></A>
|
|
|
|
<!-- *** BEGIN navbar *** -->
|
|
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="nielsen.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue57/nielsen2.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="okopnik.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
|
|
<!-- *** END navbar *** -->
|
|
<P>
|
|
</CENTER>
|
|
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4 ALIGN="center">
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<center>
|
|
<H1><font color="maroon">Mark's Web/Database Installation</font></H1>
|
|
<H1>Zope, Apache, Mysql, PostgreSQL, Perl, Python, PHP</H1>
|
|
<H4>By <a href="mailto:python@kepnet.com">Mark Nielsen</a></H4>
|
|
</center>
|
|
<P> <HR> <P>
|
|
|
|
<!-- END header -->
|
|
|
|
|
|
|
|
|
|
<ol>
|
|
<li>
|
|
<a href="#Introduction">Introduction</a></li>
|
|
|
|
<li>
|
|
<a href="#OPINION">Mark's opinion of the useful free software</a></li>
|
|
|
|
<li>
|
|
<a href="#Script">The installation script</a></li>
|
|
|
|
<li>
|
|
<a href="#Conclusion">Conclusion</a></li>
|
|
|
|
<li>
|
|
<a href="#REf">References</a></li>
|
|
|
|
</ol>
|
|
|
|
<h3>
|
|
<a NAME="Introduction"></a>Introduction</h3>
|
|
I find it easier to install services without using rpms, because I might
|
|
install different versions. I am a firm believer in never using rpms when
|
|
you have services that use custom made binary programs. The only exception
|
|
is using the Debian GNU/Linux distribution which has some neat features.
|
|
<p>Why does Mark go through the trouble of installing all these web and
|
|
database services? It is a learning tool which has been useful at all his
|
|
jobs. When the opportunity strikes to use free software, it is handy to
|
|
have live demonstrations of the capabilities of the free software. All
|
|
of the skills associated with the software below have been very useful
|
|
at various jobs.
|
|
<h2>
|
|
<a NAME="OPINION"></a>Mark's opinion on the free software</h2>
|
|
The software Mark uses is all you need to become a top notch web/database
|
|
programmer. Look at <A HREF="http://Dice.com">Dice.com</A> and other webpages. Almost of the skills you
|
|
need for commercial software can be learned first through the free software
|
|
listed below. The power of the free software is that you can use it anywhere
|
|
with unlimited possibilities. Put it on your laptop -- you don't have to
|
|
pay a license. Learn the skills you need with the free software -- you
|
|
can always get it and you can always learn it. You don't have to wait to
|
|
get a stupid license. These skills are transferable to other webservers,
|
|
databases, and most likely you will use the free languages mentioned below
|
|
at any company.
|
|
<p>Hopefully, you will be able to convince your bosses and/or companies
|
|
to use the free software. Free software is critical to save lots of money
|
|
and to create an environment where your limitations are just people and
|
|
hardware. Usually, I find it takes less people to manage well designed
|
|
large networks than all the goof-balls who install commercial software.
|
|
<p>Here is a list of reasons why Mark considers this setup very valuable:
|
|
<ol>
|
|
<li>
|
|
Python -- I was a die-hard Perl fanatic. Until Python came along. It took
|
|
me months of other people telling me to switch to Python before I decided
|
|
to do it. Now, unless I need a specific Perl module, I use Python. I am
|
|
going to see what I can do to help port Perl Modules to Python with the
|
|
mod_snake module for Apache. Python is the language to use for rapid application
|
|
development and is a key critical language for the Zope webserver. Learn
|
|
Python now, and you will be a valuable employee or consultant later. When
|
|
the market booms for Python programmers, it will be easier to get a job
|
|
in Python rather than Perl. Where Perl was 5 years ago, Python is today.
|
|
It is gaining ground in the corporate world slowly. You can create Python
|
|
binaries so that you don't need Python installed in order to run a Python
|
|
program. Python is an object-oriented language. The nice thing about Python
|
|
is that it will make JAVA binaries, and hence, I can passby writing JAVA
|
|
code. I really wish another language that was free and open would replace
|
|
JAVA in browsers. To me, JAVA needs to be replaced, or fully open-sourced
|
|
before I would consider it ethically-wise and business-wise. As long as
|
|
it is not GNUed, or some similar deal, I consider putting your life in
|
|
the hands of corporations (when you don't have to) to be skeptical.</li>
|
|
|
|
<li>
|
|
Perl -- The standard of web development. It is the most powerful language
|
|
out there for web/database development. It is not as user-friendly as PHP,
|
|
but I like it better because Perl can do more than just Web/Database stuff.
|
|
Perl and Python are the two languages I use for scripting.</li>
|
|
|
|
<li>
|
|
PHP -- A nice language for people who just want to do web/database development.
|
|
I don't use it much because I want to be really good and Perl and Python
|
|
and I don't want to spread my skills out too much.</li>
|
|
|
|
<li>
|
|
Apache -- The best webserver in the world. I don't need to explain it.
|
|
You can use Apache and SSL as a front end and put Zope behind Apache and
|
|
SSL. Thus, Zope can also be encrypted indirectly.</li>
|
|
|
|
<li>
|
|
Zope -- A very powerful webserver that offers security, database, and html
|
|
scripting all in one. It is truly the webserver to learn for rapid application
|
|
development. Zope and Apache are separate beasts that can work together
|
|
nicely with the Apache rewrite module. Apache and Zope compliment each
|
|
other and serve different purposes. If you learn Zope and Apache both,
|
|
you don't ever need to learn another webserver.</li>
|
|
|
|
<li>
|
|
PostgreSQL -- The best free database server in the world. I have noticed
|
|
that PostgreSQL is based on elegance and is somewhat similar to Oracle
|
|
for an SQL programmer. PostgreSQL has PL/pgSQL (like PL/SQL in Oracle),
|
|
it has stored procedures, its counters are similar to Oracles, and
|
|
you can embed Perl commands in side SQL statements if you compile Perl
|
|
into PostgreSQL. The only thing I don't like about PostgreSQL is its bad
|
|
handling of large objects. If PostgreSQL had an easy method to use Large
|
|
Objects like MySQL has, I would never use MySQL for private work.</li>
|
|
|
|
<li>
|
|
MySQL -- A great fast database server that a lot of companies use in combination
|
|
with PHP. I like it, but I prefer PostgreSQL because MySQL lacks a lot
|
|
of things. I don't want to spread my skills out over to many database servers,
|
|
and thus, PostgreSQL and Oracle are my choices because they have many features.
|
|
MySQL is good for fast simplistic databases. Its easy handling of large
|
|
objects is really nice, which is why I still use it. I think MySQL and
|
|
PostgreSQL serve different purposes and both are good. I like goofing around
|
|
and experimenting and trying new things, so PostgreSQL will always be it
|
|
for me.</li>
|
|
</ol>
|
|
|
|
<h2>
|
|
<a NAME="Script"></a>Installation script</h2>
|
|
|
|
<pre>#### Before anything is done, goto the apache/src
|
|
#### directory and edit Configuration.tmpl add uncomment info and so.
|
|
#### Answer y to just configure apache with mod_perl,
|
|
### but don't let mod_perl build apache.
|
|
### Add
|
|
# AddModule modules/mod_snake/libmod_snake.a
|
|
# to the end of src/Configuration.tmpl in apache.
|
|
|
|
### Then do this stuff.
|
|
|
|
cd mysql-3.22.32
|
|
mkdir /usr/local/mysql-3.22.32
|
|
./configure --prefix=/usr/local/mysql
|
|
make
|
|
make install
|
|
|
|
cd ../postgresql-7.0.2/src
|
|
mkdir /usr/local/postgresql
|
|
./configure --prefix=/usr/local/postgresql --with-perl -with-odbc
|
|
make
|
|
make install
|
|
chown -R postgres /usr/local/postgresql
|
|
|
|
### Just configure apache, but don't build it
|
|
cd ../apache_1.3.12
|
|
make clean
|
|
./configure --prefix=/usr/local/apache
|
|
|
|
cd ../mod_snake-0.2.0
|
|
./configure --prefix=/usr/local/mod_snake --with-apache=/usr/local/src/apache_1.3.12
|
|
make
|
|
make install
|
|
|
|
### Do not have perl build apache, just let is configure apache
|
|
cd ../mod_perl-1.24
|
|
make clean
|
|
perl Makefile.PL EVERYTHING=1 APACHE_PREFIX=/usr/local/apache
|
|
make test
|
|
make install
|
|
|
|
### Build apache
|
|
cd ../apache_1.3.12
|
|
make
|
|
make install
|
|
|
|
### For those of you who might try to get php3 working with php4,
|
|
### you can try to get the stuff installed, but I got the error
|
|
#Syntax error on line 208 of /usr/local/apache/conf/httpd.conf:
|
|
#Cannot load /usr/local/apache/libexec/libphp3.so into server: /usr/local/apache/libexec/libphp3.so: undefined symbol: dlst_first
|
|
#/usr/local/apache/bin/apachectl start: httpd could not be started
|
|
### Thanks to Chad Cunningham for metioning you can get both php3 and php4
|
|
### working in Apache at the same time. I still had some errors,
|
|
### so I just abandoned php3.
|
|
|
|
#cd ../php-3.0.16
|
|
#./configure \
|
|
#--enable-versioning \
|
|
#--with-pgsql=/usr/local/postgresql \
|
|
#--with-mysql=/usr/local/mysql \
|
|
#--with-config-file-path=/usr/local/apache/ --enable-track-vars \
|
|
#--with-apxs=/usr/local/apache/bin/apxs --with-xml
|
|
#make
|
|
#make install
|
|
|
|
cd ../php-4.0.1pl2
|
|
./configure \
|
|
--enable-versioning \
|
|
--with-pgsql=/usr/local/postgresql \
|
|
--with-mysql=/usr/local/mysql \
|
|
--with-config-file-path=/usr/local/apache/ --enable-track-vars \
|
|
--with-apxs=/usr/local/apache/bin/apxs --with-xml
|
|
make
|
|
make install
|
|
|
|
cd ..
|
|
mv Zope-2.2.0-src /usr/local/Zope
|
|
chown -R nobody /usr/local/Zope
|
|
cd /usr/local/Zope
|
|
### Setup the password and remember this password
|
|
su - nobody 'python wo_pcgi.py
|
|
### My hack to get a password I can remember, very bad security risk
|
|
su - nobody 'python zpasswd.py -u mark -p Something'
|
|
|
|
### Start the web servers
|
|
su -c nobody '/usr/local/Zope/start' &
|
|
chown -R nobody /usr/local/apache
|
|
/usr/local/apache/bin/apachectrl start
|
|
|
|
#### Execute this command so that php can find the mysql libraries
|
|
|
|
ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.6.0.0 /usr/lib/libmysqlclient.so.6
|
|
|
|
### Put this in your startup script for apache.
|
|
### this gets PHP working.
|
|
|
|
LD_LIBRARY_PATH=/usr/local/postgresql/lib
|
|
export LD_LIBRARY_PATH
|
|
PATH=$PATH:/usr/local/postgresql/bin
|
|
export PATH
|
|
export LIBDIR=/usr/local/postgresql/lib
|
|
|
|
/usr/local/apache/bin/apachectl start
|
|
|
|
|
|
### REMEMBER to initialize the database for postgresql and mysql.
|
|
### Execute the shell commands above
|
|
### For postgresql,
|
|
|
|
mkdir /usr/local/postgresql/data
|
|
chown -R postgres /usr/local/postgresql
|
|
cd /usr/local/postgresql
|
|
su postgresql -c '/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data'
|
|
/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data start
|
|
|
|
### To initialize MySQL
|
|
cd /usr/local/src/mysql-3.22.32
|
|
chown -R postgres /usr/local/mysql
|
|
su postgres -c 'scripts/mysql_install_db'
|
|
su postgres -c '/usr/local/mysql/bin/safe_mysqld' &
|
|
### Remember to change the password for the server and to setup
|
|
### permissions for other users.
|
|
|
|
#### Remember to setup permissions in MySQL and PostgreSQL for
|
|
#### the username that Zope and Apache un under.
|
|
|
|
#### Here are some httpd.conf file option I put at the bottom
|
|
|
|
<Files *.pl>
|
|
SetHandler perl-script
|
|
PerlHandler Apache::OutputChain Apache::SSIChain Apache::Registry
|
|
PerlSendHeader On
|
|
Options ExecCGI
|
|
</Files>
|
|
|
|
AddType application/x-httpd-php4 .php4
|
|
|
|
### I haven't yet done anything with the mod_snake module.
|
|
|
|
#### These are my files and directgries in /usr/local/src
|
|
Apache-OutputChain-0.07 Zope-2.2.0-src
|
|
Apache-OutputChain-0.07.tar.gz Zope-2.2.0-src.tgz
|
|
Apache-SSI-2.13 apache_1.3.12
|
|
Apache-SSI-2.13.tar.gz apache_1.3.12.tar.gz
|
|
ApacheDBI-0.87 mod_perl-1.24
|
|
ApacheDBI-0.87.tar.gz mod_perl-1.24.tar.gz
|
|
DBD-CSV-0.1023.tar.gz mod_snake-0.2.0
|
|
DBD-ODBC-0.28.tar.gz mod_snake-0.2.0.tar.gz
|
|
DBD-Oracle-1.06.tar.gz mysql-3.22.32
|
|
DBD-Pg-0.95.tar.gz mysql-3.22.32.tar.gz
|
|
DBD-XBase-0.161.tar.gz php-3.0.16
|
|
DBI-1.14 php-3.0.16.tar.gz
|
|
DBI-1.14.tar.gz php-4.0.1pl2
|
|
Install php-4.0.1pl2.tar.gz
|
|
Install~ postgresql-7.0.2
|
|
Msql-Mysql-modules-1.2214 postgresql-7.0.2.tar.gz
|
|
Msql-Mysql-modules-1.2214.tar.gz
|
|
|
|
</pre>
|
|
|
|
<h3>
|
|
<a NAME="Conclusion"></a>Conclusion</h3>
|
|
Well, there is no conclusion, just comments.
|
|
<br>Combining these programs with CVS, and storing any changes you make
|
|
to your database with CVS (like writing down stored procedures, formatting
|
|
of tables, webpages, etc), can be a very powerful combination for newbies
|
|
and experienced dudes.
|
|
<p>I have been telling people for years to get into the technologies above.
|
|
I have noticed an explosion of jobs requiring these skills in the past
|
|
few years. Even if you won't be using this stuff in the future, these programs
|
|
have all the tools to get you familiar with the concepts which are transferable
|
|
to any related commercial software package. The biggest threat that I had
|
|
to learning these skills, to get relatively good jobs, was the lack of
|
|
practice and lack of software to goof around on (years ago, when I wanted
|
|
to get into web/database design, to get an MS system would have cost me
|
|
well over $10,000 even as a student. Linux was around. It was all free.
|
|
It had all the stuff. It had all the programming languages, web servers,
|
|
database stuff, and networking capabilities. So here I am).
|
|
<p>The key to being a web/database developer, is getting good at one scripting
|
|
language, Javascript, HTML, generic SQL, Apache, and managing one free
|
|
database server and also CVS. From there, learn the other scripting languages,
|
|
Zope, and other database servers. If you learn all of these skills on Linux,
|
|
a lot of the software, like Apache, PostgreSQL, Perl, Python, and Zope,
|
|
are ported to NT and many Unices. Thus, you can learn it easily on the
|
|
other platforms.
|
|
<p>Hope this helps for beginners and don't hurt me for my opinions!
|
|
<p>
|
|
<h3>
|
|
<a NAME="REf"></a>References</h3>
|
|
|
|
<ol>
|
|
<li>
|
|
<A HREF="http://apache.org">apache.org</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://zope.org">zope.org</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://php.net">php.net</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://python.org">python.org</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://perl.com">perl.com</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://postgresql.org">postgresql.org</A></li>
|
|
|
|
<li>
|
|
<A HREF="http://mysql.com">mysql.com</A></li>
|
|
</ol>
|
|
|
|
<br><i>Mark works as a computer guy at <a href="http://www.tcu-inc.com">The
|
|
Computer Underground</a> and also at <a href="http://www.genericbooks.com">ZING</a>
|
|
and also at GNUJobs.com (soon).</i>
|
|
|
|
|
|
|
|
|
|
<!-- *** BEGIN copyright *** -->
|
|
<P> <hr> <!-- P -->
|
|
<H5 ALIGN=center>
|
|
|
|
Copyright © 2000, Mark Nielsen<BR>
|
|
Published in Issue 57 of <i>Linux Gazette</i>, September 2000</H5>
|
|
<!-- *** END copyright *** -->
|
|
|
|
<!--startcut ==========================================================-->
|
|
<HR><P>
|
|
<CENTER>
|
|
<!-- *** BEGIN navbar *** -->
|
|
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="nielsen.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue57/nielsen2.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="okopnik.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
|
|
<!-- *** END navbar *** -->
|
|
</CENTER>
|
|
</BODY></HTML>
|
|
<!--endcut ============================================================-->
|