Here is a copy of my current install.
sorry about the readability, it seems cut and paste and this form don't get along.
As far as places to get the software:
www.php.net
www.gingerall.com (sablotron/expat link)
www.mysql.com
www.postgresql.org
www.apache.org
The origonal Win Doc file I will put up on our server. http://neo2.dyrectmedia.com/phpinstall.doc
Keep in mind, that this doc is a bit out of date. Since newer versions of software have come out, and some bugs have been fixed.
INSTALL instructions for content management servers.
RedHat 7.0:
These are not step-by-step instructions, just an overview.
“Install type” is “custom system”
partitions: this depends on the server. The basic idea is to 1) keep /var on a
separate partition from everything else, in case some logging system goes
haywire and tries to fill up the partition; 2) keep /home, /, /boot, and /usr
on separate partitions to minimize any complications from disk failure, or
malicious code.
App server (40 GBs total):
/ 100 MB
/boot 30 MB
/var 5 GB
swap 2 GB
/usr 10 GB
/home whatever’s left over
DB server (40 GBs total):
/ 100 MB
/boot 30 MB
/var 5 GB
swap 2 GB
/usr whatever’s left over
/home 1 GB
package selection: unclick everything except the following:
Networked Workstation
Emacs
Development
Kernel Development
Utilities
Select Individual Packages: only install packages currently
being used; other packages, such X-related packages, will never
be used, and have security risks associated with installing them
(especially if they run daemons without us knowing). Also, this
listing is not exhaustive, I may have missed something to delete.
Applications
Archiving
+unzip
+zip
Internet
+lynx
Publishing
-ghostscript
-ghostscript-fonts
-mpage
-pnm2ppa
-rhs printfilters
Documentation
+kernel-doc
System Environment
Daemons
-LPRng
-Xfree86-xfs
Libraries
-Xfree86-libs
User Interface
X
-urw-fonts
Databases:
I've given instructions for installing mysql and postgresql.
Normally we keep these on machines separate from the appservers,
but there have been cases when we were forced to put both on
the same machine, so I included the instructions in the
appropriate place. You can skip them if you don't want them.
Installing sudo
the rpm is on the second redhat7.0 disk:
cp /RedHat/RPMS/sudo-1.6.3-4.i386.rpm
/usr/local/src
rpm -iv sudo-1.6.3-4.i386.rpm
to edit the sudoers file, adding any users that should have root access, just run this
command:
/usr/sbin/visudo
Updating the clocks
check the date, the hardware/system clocks are usually not well-synced
with our time, use hwclock(8) to make changes
hwclock --set --date="2/10/01 16:40:00"
hwclock --hctosys
Removing service startup scripts
remove unneeded services from starting up that redhat always installs:
cd /etc/rc.d/
rm -f rc?.d/???apmd
rm -f rc?.d/???gpm
rm -f rc?.d/???netfs
rm -f rc?.d/???pcmcia
rm -f rc?.d/???rawdevices
rm -f rc?.d/???rhnsd
rm -f rc?.d/???sendmail
rm -f rc?.d/???xfs
rm -f rc?.d/???lpd
rm -f rc?.d/???portmap
rm -f rc?.d/???nfslock
rm -f rc?.d/???nfs
Installing ssh
-unzip and untar
./configure; make; make install
edit /etc/rc.d/rc.local by adding the following to the top of it:
starting ssh daemon
/usr/local/sbin/sshd
Installing mysql
download the tar.gz file src file and put it in /usr/local/src
cd /usr/local/src
<gunzip, untar, and cd into the new dir>
./configure --prefix=/usr/local/mysql
make (this takes a while, go get some coffee)
make install
cd support-files
mv mysql.server /etc/rc.d/init.d/mysql
edit that new "mysql" file, so that the line
$bindir/safe_mysqld --datadir=$datadir \
--pid- file=$pid_file &
looks like this:
$bindir/safe_mysqld --user=mysql \
--datadir=$datadir --pid-file=$pid_file &
chmod 755 /etc/rc.d/init.d/mysql
cd /usr/local/mysql/bin
./mysql_install_db
make a mysql group and user (see below for instructions)
chown -R mysql:mysql /usr/local/mysql/var
add mysql start/stop to the rc?.d directories (start: S99, stop: K00)
add /usr/local/mysql/lib to the /etc/ld.so.conf file and run
/sbin/ldconfig -v
Installing postgresql
download the tar.gz file and place it in /usr/local/src
cd /usr/local/src
gunzip, untar, and cd into the new dir
cd src
./configure --prefix=/usr/local/pgsql \
--enable-multibyte
make
make install
make a postgres group and user (see below for instructions)
make a start/stop script for postgres in /etc/rc.d/init.d (or get it from me)
chown 755 /etc/rc.d/init.d/postgres
add /usr/local/pgsql/lib to the /etc/ld.so.conf file and run
/sbin/ldconfig -v
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su -c "/usr/local/pgsql/bin/initdb -D \
/usr/local/pgsql/data" postgres
mkdir /var/log/pgsql
chown postgres:postgres /var/log/pgsql
Installing apache
tar and gunzip source into /usr/local/src
./configure \
--enable-module=so \
--logfiledir=/var/log/httpd --runtimedir=/var/run \
--enable-rule=SHARED_CORE \
--prefix=/usr/local/apache \
--htdocsdir=/home/www
make
make install
make an httpd group and user
change /var/log/httpd to be accessible by root:httpd
chgrp httpd /var/log/httpd
chmod 775 httpd
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d
add start/stop symlinks (K00, S99)
uncomment ServerName in
/usr/local/apache/conf/httpd.conf
edit /usr/local/apache/conf/httpd.conf to have this:
User httpd
Group httpd
LogLevel info
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
Installing libxml2
./configure
make
make install
edit /etc/ld.so.conf to_point_to/usr/local/libxml/lib
and run ‘/sbin/ldconfig -v’
Installing expat
gunzip, untar,
./configure
make
make install
Installing sablotron
gunzip, untar,
./configure
make
make install
edit ld.so.conf and run /sbin/ldconfig -v
Installing postgresql libs
if you setup the db server first, then that server will already
have the necessary libs on it. Just copy the following over
to the app server and put them in /usr/local/pgsql/lib:
libecpg.a
libecpg.so
libecpg.so.3
libecpg.so.3.1.1
libpgeasy.a
libpgeasy.so
libpgeasy.so.2
libpgeasy.so.2.1
libpq++.a
libpq++.so
libpq++.so.3
libpq++.so.3.1
libpq.a
libpq.so
libpq.so.2
libpq.so.2.1
plpgsql.so
then copy the following in /usr/local/pgsql/include:
everything in the same dir from the DB server
otherwise, you'll need to download, configure, make the postgres
stuff, and then put only the necessary libs in.
**after copying them in, edit ld.so.conf and run /sbin/ldconfig -v
Installing PHP
gunzip, untar
./buildconf
./configure \
--with-mysql \
--with-apxs=/usr/local/apache/bin/apxs \
--enable-track-vars \
--enable-sablot-errors-descriptive \
--with-sablot=/usr/local/lib \
--with-dom=/usr/local/lib \
--with-pgsql=/usr/local/pgsql \
--enable-wddx
make
make install
copy php.ini-dist to /usr/local/lib/php.ini
edit it to this:
log_errors = On
track_errors = On
error_log = /var/log/php.log
in /usr/local/apache/conf/httpd.conf, uncomment this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
restart httpd
Creating Groups and Users
Here’s an example making a user for the mysql daemon:
groupadd mysql
useradd -g mysql -s /bin/false -c ‘MySQL Server’ mysql
rm -rf /home/mysql
Explanation of flags and their values:
-g the name of the group that user mysql will belong to
-s the path to the shell that the user uses to log in with; we
set this to the program false so that no one can log in
as mysql
-c the common name of the user
mysql the username of the user
***postgresql is unusual. It seems to make a check to see if a shell has been
assigned to the user postgres, and will not start up if a shell is given. Therefore, after creating the group and user postgres, you will need to edit the /etc/passwd file and delete postgres’ shell:
Change this:
postgres❌504:16😛ostGres Daemon:/home/postgres:/bin/false
To this:
postgres❌504:16😛ostGres Daemon:/home/postgres: