CentOS 5.4 Installation
Contents
- CentOS 5.4 Installation
- Start Newly Installed System
- Check available software
- Install development tools
- Install mysqld
- Install additional php packages and pear
- Configure php.ini
- httpd Configuration
- Turn off firewall
- Test basic httpd functionality
- Setup basic DrawMGT application
- User Setup
- Install PHP Modules
- Mysql Cofiguration
- Install Image Magick
- Install TexLive 2012
- Install htmldoc
- Install mysql php extensions
- System Administration Commands
Incomplete - These notes are from CenTOS 5.3 installation in 2009 and 5.4 installation in Aug 2010.
CentOS Installation and Configuration
Installation of CentOS 5.3 or 5.4 from DVD
Boot system with DVD in drive
Boot screen appears and gives you the choice of a graphical or a text installation. Perform the text installation, and follow the instructions below
boot: linux text Dialog: CD Found - Asks if media test should be performed OK Media check - Confirm media test Test OK Continue Running anaconde, the CentOS system installer - please wait ..runs in text mode CentOS - Welcome to CentOS OK Language Selection: English Keyboard Selection US Partition Type: _ Remove all partitions on selected drives and create default layout _ Remove all linux partitions on selected drives and create default layout _ Use free space on selected drives and create default layout * Create custom layout <-- select this choice Which drives do you want to select for this installation [x] hda OK Delete any existing partitions Add partition: Type: swap, Fixed size 6000 MB, Force primary partition Add partition: Mount point /boot, Type: ext3, Fixed size 500 MB, Force primary partition Add partition: Mount point /, Type: ext3, Fill all available space, force primary partition Low memory - Answer OK for immediately installing partition table Boot Loader Configuraton (x) Use GRUB book loader OK Boot Loader Configuraton _______ Options (leave blank) [ ] Force use of LBA32 (leave blank) OK Boot Loader Configuraton [ ] Use a GRUB password (leave blank Password __________ (leave blank) Confirm __________ (leave blank) Boot Loader Configuraton Default CentOS OK Boot Loader Configuraton Where do you want to install bot loader /dev/hda Master boot record (accept default) OK Configure network interface Yes Network Configuration for eth0 [*] activate on boot [*] enable IPv4 support [ ] enable IPv6 support OK IPv4 Configuration for eth0 -- Could also do a manual configuration, then you need to set hostname, IP, gateway and DNS nameserver (*) Dynamic IP configuration (DHCP) OK Hostname configuration (*) Automatically via DHCP Time Zone Selection [*] System clock uses UTC Europe/Zurich Root Password Password ___________ Password (confirm) ___________ Installation Progress... Package Selection [x] Server [ ] Server - GUI Dependency Check... Installation to begin OK Formattting Formatting / file system... Formatting /boot file system... Copying file Transferring install image to hard drive... Package Installation Install Starting.. Starting install process. This mau take take several minutes... Total packages to install 455 (approx) ..installs packages... Bootloader Installing boatloader.. Complete ..ejects DVD.. Press <enter> to reboot system
Start Newly Installed System
Reboot System reboots.. ..displays boot messages Setup Agent Select the item that you wish to modify Authentication Firewall configuration Network configuration System services Select 'System services': Enable: httpd Times out after a couple of minutes and displays a login prompt
Check available software
- no cc/gcc
- php version 5;1;6
- httpd 2.2.3
- mysql 5.0.45
- perl 5.8.8
- no pear
# Probably not needed: #Create an ISO repo # # yum install cretaerepo # ... #
Install development tools
- yum groupinstall 'Development Tools'
- .73 packages to install, 63 MB to download.
- .downloads packages..
- .installs them
Install mysqld
yum install php-mysql mysql mysql-server /sbin/chkconfig --levels 235 mysqld on vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 character_set_server=utf8 innodb_buffer_pool_size = 256M innodb_additional_mem_pool_size = 32M innodb_lock_wait_timeout = 30 innodb_file_per_table # From mysql 5.5.3 use lock_wait_timeout instead of table_lock_wait_timeout table_lock_wait_timeout=30 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid /etc/init.d/mysqld start /usr/bin/mysql_secure_installation
Install additional php packages and pear
yum install php-mbstring yum install php-pear
Note that you might get errors that state the the version of pear is too low to be able to installed the desired package. In this case you must upgrade pear (pear upgrade --force pear)
Configure php.ini
cd /etc cp php.ini php.ini-ORIG diff php.ini-ORIG php.ini 221c221 < allow_call_time_pass_reference = Off --- > allow_call_time_pass_reference = On 312c312 < max_execution_time = 30 ; Maximum execution time of each script, in seconds --- > max_execution_time = 120 ; Maximum execution time of each script, in seconds 367c367 < display_errors = Off --- > display_errors = On 421c421 < ;error_log = filename --- > error_log = /var/log/php_errors.log 477c477 < post_max_size = 8M --- > post_max_size = 128M 512c512 < ;include_path = ".:/php/includes" --- > include_path = ".:/php/includes:/usr/share/pear" 582c582 < upload_max_filesize = 2M --- > upload_max_filesize = 128M 626c626,627 < --- > extension=http.so > 841c842 < ;browscap = extra/browscap.ini --- > browscap = /etc/browscap.ini 944c945 < session.gc_divisor = 1000 --- > session.gc_divisor = 500 948c949 < session.gc_maxlifetime = 1440 --- > session.gc_maxlifetime = 36000
The session timeout (timeout for automatic logout) is set also in php.ini. See Setting Session Timeout.
Install a browscap.ini file. Download php_browscap.ini from http://browsers.garykeith.com/downloads.asp, change the name to browscap.ini, and save it in the /etc.
httpd Configuration
Configure httpd:
cd /etc/httpd/conf/ cp httpd.conf httpd.conf-ORIG diff httpd.conf-ORIG httpd.conf 265c265,266 < #ServerName www.example.com:80 --- > ServerName narvi.softxs.ch:80 327c328,329 # In the block for <Directory "/var/www/html"> < AllowOverride None --- > AllowOverride All
Start httpd:
/sbin/chkconfig --levels 235 httpd on /etc/rc.d/init.d/httpd start
Create test documents root at /var/www/html, for showing that httpd can serve files and run php programs.
vi index.html <html> <body> <h1>skuld.softxs.ch</h1> </body> </html> vi test.php <?php phpinfo(); ?>
Turn off firewall
cd /etc/rc.d/init.d ./iptables stop /sbin/chkconfig --levels 235 iptables off
Test basic httpd functionality
Check that you can:
Able to access http://skuld.softxs.ch/index.html
Able to access http://skuld.softxs.ch/test.php
Setup basic DrawMGT application
- See ?
User Setup
Add user drawmgt
- groupadd drawmgt
- useradd drawmgt -c'DrawMGT User' -g drawmgt -G apache
- usermod apache -G drawmgt
Install PHP Modules
pear download pear pear upgrade --force PEAR-1.9.4 pear install Log pear install Mail # If you get a dependency error, use the command: '''pear install --alldeps Mail''' pear install Mail_Mime yum install zlib-devel # Needed for CentOS 5.4 yum install curl-devel # Needed for CentOS 5.4 pear install pecl/pecl_http pear install Services_JSON
Add the line "extension=http.so" to /etc/php.ini and restart httpd
Mysql Cofiguration
Configure mysqld
mysql grant all privileges on *.* to 'alan'@'localhost.softxs.ch'; grant all privileges on *.* to 'alan'@'localhost'; flush privileges; quit; mysqladmin -u root password 'sqladmin' mysqladmin -u root -h skuld password 'sqladmin'
For other steps see at FreeBSD installation.
Install Image Magick
To allow to create thumbnail files ghostscript and ImageMagick must be installed. The versions in the CentOS distribution are quite old. Newer versions must be installed:
# Ghostscript must be installed from source wget --no-proxy http://downloads.ghostscript.com/public/ghostscript-9.06.tar.gz tar xvf ghostscript-9.06.tar.gz cd ghostscript-9.06 ./configure make make install # There are precompiled ImageMagick for CentOS wget --no-proxy http://www.imagemagick.org/download/linux/CentOS/i386/ImageMagick-6.7.9-10.i386.rpm rpm -i ImageMagick-6.7.9-10.i386.rpm # Edit ImageMagick configuration to use the new ghostscript cp /etc/ImageMagick/delegates.xml /etc/ImageMagick/delegates.xml.orig vi /etc/ImageMagick/delegates.xml :%s:"gs":\"/usr/local/bin/gs\":g :x
Install TexLive 2012
To allow to create LaTeX submital/transmittal cover letters TexLive 2011 or 2012 must be installed as root.
vi ~/.wgetrc use_proxy = off wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz tar xvf install-tl-unx.tar.gz cd install-tl-20120827 install-tl PATH="$PATH:/usr/local/texlive/2012/bin/i386-linux" mkdir /usr/local/texlive/2012/texmf/tex/latex/ltablex/ cd /usr/local/texlive/2012/texmf/tex/latex/ltablex/ wget http://ctan.ijs.si/tex-archive/macros/latex/contrib/ltablex/ltablex.sty texhash # change PATH to contain texlive binaries cat > /etc/profile.d/texlive.csh if ( "${path}" !~ */usr/local/texlive/2012/bin/i386-linux* ) then set path = ( /usr/local/texlive/2012/bin/i386-linux $path ) endif ^D cat > /etc/profile.d/texlive.sh if ! echo ${PATH} | /bin/grep -q /usr/local/texlive/2012/bin/i386-linux ; then PATH=/usr/local/texlive/2012/bin/i386-linux:${PATH} fi ^D
Install htmldoc
To be completed.
Install mysql php extensions
Done above?
System Administration Commands
To start/stop services:
cd /etc/rc.d/init.d ./{service_script} start | stop | status
To enable/disable services at boot: use 'chkconfig' and/or 'service'
chkconfig --list # List services and whether they are enabled/disabled at each run level chkconfig {service} on|off
To shutdown the system:
init 0