Install a new server (CentOS)

From Organic Design wiki
Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, this is only useful for a historic record of work done. You may find a link to the currently used concept or function in this article, if not you can contact the author to find out what has taken the place of this legacy item.

<bash>

  1. !/bin/bash
  2. ---------------------- Installation on wikiexpert.com -------------------------- #
  1. DATA & TIMEZONE
  2. Make sure time is set correctly before wiki install
  3. On Redhat, PERL could not do locale properly and I had to hard-wire Linux zone with

cp /etc/localtime /etc/localtime.bak cp /usr/share/zoneinfo/NZ /etc/localtime

  1. Original rpm apache installation in /var/www controlled with /usr/sbin/apachectl
  2. /var/www/html/index.shtml is the index file
  3. Source install at /usr/local/apache2
  4. Apache now controlled with /usr/local/apache2/bin/apachectl

cd /tmp wget http://apache.mirror99.com/httpd/httpd-2.2.0.tar.gz tar -zxvf httpd-2.2.0.tar.gz cd httpd-2.2.0 ./configure --enable-rewrite --enable-ssl make make install ###### NOTE Apche was not installed into init.d #####


  1. ------------------------- Zlib and BZip ------------------------------ #

cd /tmp wget http://www.zlib.net/zlib-1.2.3.tar.gz tar -zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure make make install wget http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz tar -zxvf bzip2-1.0.3.tar.gz cd bzip2-1.0.3.tar.gz make make install


  1. --------------------- Installing mysql 5.0.19 from source --------------------- #
  2. see INSTALL-BINARY

wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/mysql-standard-5.0.19-linux-i686.tar.gz /usr/sbin/groupadd mysql /usr/sbin/useradd -g mysql mysql cd /usr/local gunzip < /tmp/mysql-standard-5.0.19-linux-i686.tar.gz | tar xvf - ln -s /usr/local/mysql-standard-5.0.19-linux-i686 mysql cd mysql ./scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data chgrp -R mysql . ./bin/mysqld_safe --user=mysql & ##### NOTE - MySQL was not installed into init.d #####


  1. --------------------------- ming in /usr/local/lib/ --------------------------- #
  2. See http://www.opaque.net/wiki/index.php?MingInstall,
  3. http://www.opaque.net/wiki/index.php?PlatformIssues

cd /tmp wget http://superb-west.dl.sourceforge.net/sourceforge/ming/ming-php-0.3.0.tar.gz tar -zxvf ming-php-0.3.0.tar.gz cd ming-0.3.0/php_ext cp -rf * ../../php-4.4.2/ext/ming/

  1. copy png2dbl into /usr/local/apache2/htdocs/wiki/png2dbl

chown daemon /usr/local/apache2/htdocs/wiki/png2dbl chmod 755 /usr/local/apache2/htdocs/wiki/png2dbl mkdir /usr/local/apache2/htdocs/www chown daemon /usr/local/apache2/htdocs/www chmod 777 /usr/local/apache2/htdocs/www


  1. ---------------------------------- PHP-4.4.2 ----------------------------------- #

cd /tmp wget http://us2.php.net/distributions/php-4.4.2.tar.gz tar -zxvf php-4.4.2.tar.gz cd php-4.4.2 ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-ming

      --with-xml --with-domxml --with-zlib-dir=/usr/local/lib

make make install cp php.ini-dist /usr/local/lib/php.ini nano /usr/local/lib/php.ini

  1. memory_limit = 64M
  2. extension_dir = "/usr/lib/php4/"
  3. extension=domxml.so
  4. extension=mbstring.so

vi /usr/local/apache2/conf/httpd.conf

  1. HTTPD.CONF
  2. Add: LoadModule php4_module module/libphp4.so
  3. Add: AddType application/x-httpd-php .php .phtml
  4. Add: index.php to DirectoryIndex directive
  5. Uncomment include of extra/httpd-vhosts
  6. Change document root to /var/www
  7. IMPORTANT: Uncomment the line which says EnableSendFile off
  1. CURRENT VIRTUAL HOSTS FILE

NameVirtualHost *:80 <VirtualHost *:80>

   DocumentRoot /var/www/organicdesign
   ServerName organicdesign.co.nz
   ServerAlias www.organicdesign.co.nz
   RewriteEngine On
   RewriteCond %{REQUEST_URI} !^/w.*/
   RewriteRule ^/(.*) /wiki/index.php?title=$1 [L]

</VirtualHost> <VirtualHost *:80>

   DocumentRoot /var/www/kaizen
   ServerName kaizenexpert.com
   ServerAlias www.kaizenexpert.com
   RewriteEngine On
   RewriteCond %{REQUEST_URI} !^/w.*/
   RewriteRule ^/(.*) /wiki/index.php?title=$1 [L]

</VirtualHost>


  1. ---------------------------------- SCP ----------------------------------- #
  2. - you need all this to do SCP from Perl without requiring an linux account with no passwd

wget http://search.cpan.org/CPAN/authors/id/R/RG/RGIERSIG/IO-Tty-1.02.tar.gz gzip -dc IO-Tty-1.02.tar.gz | tar -xof - cd IO-Tty-1.02 perl Makefile.PL make install

wget http://search.cpan.org/CPAN/authors/id/R/RG/RGIERSIG/Expect-1.15.tar.gz gzip -dc Expect-1.15.tar.gz | tar -xof - cd Expect-1.15 perl Makefile.PL make install

wget http://search.cpan.org/CPAN/authors/id/P/PH/PHOENIX/Term-ReadPassword-0.07.tar.gz gzip -dc Term-ReadPassword-0.07.tar.gz | tar -xof - cd Term-ReadPassword-0.07 perl Makefile.PL make install

wget http://search.cpan.org/CPAN/authors/id/D/DJ/DJBERG/Net-SCP-Expect-0.12.tar.gz gzip -dc Net-SCP-Expect-0.12.tar.gz | tar -xof - cd Net-SCP-Expect-0.12 perl Makefile.PL make install

  1. Setup CPAN

perl -MCPAN -e shell

  1. cpan> install Bundle::CPAN
  2. cpan> reload cpan
  3. cpan> install IO::Socket::SSL
  4. cpan> exit


  1. ----------------------- Upgrading gcc to gcc-4.1.1 for R --------------------------- #
  2. Check off list http://gcc.gnu.org/install/prerequisites.html

cd /tmp wget ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.1.1/gcc-4.1.1.tar.bz2 bunzip2 gcc-4.1.1.tar.bz2 tar -xvf gcc-4.1.1.tar cd gcc-4.1.1 ./configure --prefix=/usr/local --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix

           --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit
           --host=i386-redhat-linux --enable-languages=c,c++,fortran

make make install


  1. -------------------------- Installing R from source -------------------------------- #
  2. Two major releases of R each year, currently R-2.3.1

cd /tmp wget http://cran.cnr.berkeley.edu/src/base/R-2/R-2.3.1.tar.gz tar -zxvf R-2.3.1.tar.gz cd R-2.3.1 ./configure --with-x=no # Using fortran compiler in gcc make make install </bash>