Create User and Dirs:
    adduser berylium
    cd /home/berylium
    mkdir code data doc files http shttp mail logs
    chmod 775 files

OpenSSL: 
ports://usr/ports/security/openssl


MySQL:
MD5 (/home/csnyder/mysql-3.23.48.tar.gz) = 29c46bcd99d6493d6117900dabbf86fa

    useradd -s /bin/false mysql
    
    ./configure --prefix=/usr/local/mysql --localstatedir=/home/mysql/data
    make
    make install
    scripts/mysql_install_db
    chown -R mysql.mysql /usr/local/mysql /home/mysql
    
    /usr/local/mysql/bin/safe_mysqld --user=mysql &
    
    mysqladmin -u root password new_password
    
    *** to setup mysql for berylium ***
    Connect using the mysql client and...
    CREATE DATABASE beryliumdb;
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON beryliumdb.* TO berylium@localhost IDENTIFIED BY 'image id of rep image' ;
    GRANT SELECT, INSERT, UPDATE ON beryliumdb.* TO nobody@localhost IDENTIFIED BY 'year of the horse' ;
    GRANT SELECT, INSERT, UPDATE ON beryliumdb.* TO nobody@"%" IDENTIFIED BY 'year of the horse' ;


Apache (SSL & PHP4):
MD5 (apache_1.3.22.tar.gz) = 77d34c0ac49c3af2416b786228007f90
MD5 (php-4.1.1.tar.gz) = 776362ff53bf6ea77b60496f6632b6b6
MD5 (mod_ssl-2.8.5-1.3.22.tar.gz) = 5139c874e759b8410a29f9dcb4b578e5

    Unpack archives in src/
    
    (Apache configure)
	cd mod_ssl-2.6.x-1.3.x
	./configure --with-apache=../apache_1.3.22  
	cd ../apache_1.3.14
	EAPI_MM=SYSTEM; ./configure --enable-module=ssl --prefix=/usr/local/apache --enable-module=rewrite --disable-module=userdir
    
    (PHP Install)
	cd ../phpdir
	./configure --with-apache=/home/berylium/code/src/apache_1.3.22 --with-mysql --with-gettext --enable-track-vars (--with-mcrypt)
	You already installed bison and flex, right? (And mcrypt? heh.)
	
	make
	make install
    
    (Apache install)
	cd ../apache
	./configure --enable-module=ssl --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a --enable-module=rewrite --disable-module=userdir
	make
	make install
    
    (PHP Config)
	cd ../php
	cp php.ini-dist /usr/local/lib/php.ini
	pico /usr/local/apache/conf/httpd.conf
    
    (Apache Config)
	Create Keys and Certs and Stuff:
	keys/server.key:
	certs/server.crt
	keys/ca/ca.key
	certs/ca/ca.crt
	
	In ./keys/
	1) Create a server private key (remember the pass phrase!)
	   /usr/local/ssl/bin/openssl genrsa -des3 -out server.key 1024 
	
	2) Create a local CA key:
	   cd ca/
	   /usr/local/ssl/bin/openssl genrsa -des3 -out ca.key 1024
	
	In ./certs/
	1) Use key to create a certificate signing request:
	   /usr/local/ssl/bin/openssl req -new -key ../keys/server.key -out server.csr 
	   Common name matches server name.
	
	2) cd ca/
	
	3) Create a self-signed CA certificate
	   /usr/local/ssl/bin/openssl req -new -x509 -days 365 -key ../../keys/ca/ca.key -out ca.crt 
	
	4) Use sign.sh to sign server.csr
	   cp /usr/local/src/mod_ssl-2.7.1-1.3.14/pkg.contrib/sign.sh sign.sh
	   edit sign.sh and add path to openssl
	   ./sign.sh ../server.csr
	
	/usr/local/apache/bin/apachectl start

