Differences

This shows you the differences between two versions of the page.

Link to this comparison view

centos_bare_stack [2012/08/06 09:16]
centos_bare_stack [2012/08/06 09:16] (current)
Line 1: Line 1:
 +====== CentOS Bare Stack ======
  
 +  * [[CentOS]]
 +  * [[CentOS Deployment]]
 +  * [[Apache Source Installation]]
 +  * [[OpenSSL Source Installation]]
 +
 +Goals:
 +
 +  * Strip an existing install of CentOS packages
 +  * Use CentOS development tools (gcc, make, autoconf, etc.)
 +  * Build AMP stack manually for future maintenance
 +  * Duplicate standard CentOS install locations (using /usr as prefix, etc.)
 +
 +==== Minimal Install ====
 +
 +Since it's more likely than not that you are starting with an existing CentOS install, the first place to begin is by stripping it down to its basics. ​ There are some packages you'll want to download first to make sure you have access to fetch things from the Internet.
 +
 +Here are some basics you should download the source files for before removing any packages:
 +
 +  * openssl
 +  * elinks
 +  * screen
 +  * vim
 +  * dropbear
 +  * openssh
 +  * htop
 +
 +== Current Package Set ==
 +
 +Get a list of the currently installed programs:
 +
 +<​code>​
 +yum list installed | cut -d " " -f 1
 +</​code>​
 +
 +==== Remove Packages ====
 +
 +There is a list of "​safe"​ packages that can be removed without affecting any existing LAMP systems:
 +
 +<​code>​
 +yes N | yum remove `curl -s http://​centos.digitaltrike.com/​minimal/​remove-packages/​safe`
 +</​code>​
 +
 +=== Base Packages ===
 +
 +Need to reinstall:
 +
 +  * sudo
 +  * vim
 +
 +<​code>​
 +yes N | yum remove `curl -s http://​centos.digitaltrike.com/​minimal/​remove-packages/​base`
 +</​code>​
 +
 +== sudo ==
 +
 +You will need the pam.d sudo file, since yum will remove it.
 +
 +<​code>​
 +yum -y remove sudo
 +wget http://​centos.digitaltrike.com/​minimal/​pam.d/​sudo -O /​etc/​pam.d/​sudo
 +</​code>​
 +
 +You will also need to run ''​visudo''​ again to setup proper permissions.
 +
 +=== Desktop Packages ===
 +
 +Need to reinstall:
 +
 +  * gd
 +  * ImageMagick
 +
 +<​code>​
 +yes N | yum remove `curl -s http://​centos.digitaltrike.com/​minimal/​remove-packages/​desktop`
 +</​code>​
 +
 +=== System Packages ===
 +
 +<​code>​
 +yes N | yum remove `curl -s http://​centos.digitaltrike.com/​minimal/​remove-packages/​system`
 +</​code>​
 +
 +==== Install Packages ====
 +
 +First let's start with the base system, and the applications you are already familiar with.  Install these from source:
 +
 +  * htop
 +  * unfoo
 +  * vim
 +  * libpng
 +  * libjpeg
 +  * libgd
 +  * imagemagick
 +
 +=== vim ===
 +
 +Create a symlink when finished for CentOS compatability:​
 +
 +<​code>​
 +ln -s /​usr/​bin/​vim /bin/vi
 +</​code>​
 +
 +=== OpenSSL ===
 +
 +You'll need to keep the OpenSSL libraries that are installed with CentOS to maintain the existing system. ​ You can upgrade to the latest OpenSSL version and overwrite the old install, if desired.
 +
 +=== OpenSSH ===
 +
 +Install binary as needed, then download the pam.d and init.d files, and add the script to startup:
 +
 +<​code>​
 +mkdir -p /​var/​empty/​sshd/​etc
 +chmod 0711 /​var/​empty/​sshd
 +wget http://​centos.digitaltrike.com/​init.d/​sshd -O /​etc/​init.d/​sshd
 +chmod +x /​etc/​init.d/​sshd
 +wget http://​centos.digitaltrike.com/​minimal/​pam.d/​sshd -O /​etc/​pam.d/​sshd
 +chkconfig --add sshd
 +chkconfig sshd on
 +</​code>​
 +
 +=== ImageMagick ===
 +
 +You'll need some development libraries before installing:
 +
 +CentOS packages:
 +
 +<​code>​
 +yes N | yum install `curl -s http://​centos.digitaltrike.com/​minimal/​install-packages/​graphics`
 +</​code>​
 +
 +Source libraries:
 +
 +  * [[http://​centos.digitaltrike.com/​minimal/​config/​config-gd|config-gd]]
 +  * [[http://​centos.digitaltrike.com/​minimal/​config/​config-jpeg|config-jpeg]]
 +  * [[http://​centos.digitaltrike.com/​minimal/​config/​config-libpng|config-libpng]]
 +
 +Once all the libraries are installed, you can install ImageMagick:​
 +
 +  * [[http://​centos.digitaltrike.com/​minimal/​config/​config-imagemagick|config-imagemagick]]
 +
 +=== Apache ===
 +
 +  * [[http://​dev.digitaltrike.com/​~steve/​downloads/​centos/​minimal/​config/​config-httpd|config-httpd]]
 +
 +Safely remove Apache and related applications:​
 +
 +<​code>​
 +yes N | yum remove `curl -s http://​centos.digitaltrike.com/​minimal/​remove-packages/​httpd`
 +</​code>​
 +
 +Apache comes with templates for directory layouts in ''​config.layout''​. ​ In this case, use ''​--enable-layout=RedHat''​
 +
 +=== ruby ===
 +
 +Ruby is a little different, in that you cannot install it directly from the source code, because it requires a previous version of ruby installed to do that.  You can, instead, use rvm to install it:
 +
 +<​code>​
 +echo insecure >> ~/.curlrc
 +curl -L get.rvm.io | bash -s stable
 +gpasswd -a dtrike rvm
 +source /​etc/​profile.d/​rvm.sh
 +rvm install 1.9.3
 +</​code>​