Another note in my blog to install Apache 2.2.17 with PHP 5.3.5, and now i’m going to use EPEL and WEBTATIC Repository, let’s start!
VPS: CentOS 5.5 64bit with 512MB RAM OpenVZ
Add EPEL and WEBTATIC repository to your vps
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/`uname -i`/epel-release-5-4.noarch.rpm rpm -import http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm rpm -import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
Install Apache 2.2.3 and additional modules, update your CentOS, and add make it automatically starts
yum -y install httpd perl libperl GeoIP GeoIP-devel GeoIP-data zip unzip nano yum -y update chkconfig --add httpd chkconfig httpd on
Remove your old PHP and MySQL (if exist)
rpm -qa | grep mysql rpm -e mysql rpm -qa | grep php rpm -e php yum -y remove php php-mysql mysql mysql-server
Create domain root
Just like the old time, i’m using ‘/home’ base directory, create one user under it to control all domains so you don’t have to worry about ftp permission. Also to make the user more secure, i’m disabling shell function.
useradd www -s /bin/false passwd www mkdir -p /home/www/yourdomain/public_html mkdir -p /home/www/yourdomain/logs
Set ‘www’ user permission recursively
chmod 755 /home/www/domensitu.com /home/www/domensitu.com/public_html /home/www/domensitu.com/logs chown -R www:www /home/www
Install PHP 5.3.5 and additional modules
You can set your own required modules here.
yum --enablerepo=webtatic -y install php php-cli php-common php-mcrypt php-devel php-mbstring sudo patch libtool libmcrypt-devel libxml2-devel make automake gcc gcc-c++ sudo flex bison wget zlib-devel openssl-devel pcre pcre-devel pcre-devel gd-devel bzip2* libc-client-devel.`uname -i`
Install MySQL 5.5
Try to remove your previous MySQL once again first.
yum -y remove mysql mysql-* yum --enablerepo=webtatic -y install libmysqlclient15 mysql55 mysql55-server php-mysql /etc/init.d/mysqld start chkconfig --add mysqld chkconfig mysqld on
Securing your MySQL, take a look at my previous post here
Now edit httpd.conf
nano /etc/httpd/conf/httpd.conf
Add the following lines
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php index.htm index.html
Change “AllowOverride None” to “AllowOverride All” so you can use your own .htaccess configuration
Options FollowSymLinks
AllowOverride All
Change Apache User and Group to ‘www‘ user
User www
Group www
Uncomment “NameVirtualHost” dan change the asterix (*) with your box IP
NameVirtualHost 123.456.789.101:80
And the last thing, add Virtual Host for your domain configuration
ServerAdmin youremailaddress
DocumentRoot /home/www/yourdomain/public_html
ServerName yourdomain
ErrorLog /home/www/yourdomain/logs/error.log
CustomLog /home/www/yourdomain/custom.log common
So Apache 2.2.3 with PHP 5.3.5 and MySQL 5.5 is now ready to rock!!!
Related Post:
– Install PureFTPD
– Install phpMyAdmin
Reference:
– Uncle G
– lamphowto.com
– webtatic.com
is waiting for auto installer 🙂
hi there, i was thinking to create autoinstaller for Apache too, but i’ll start after i published a new NginX auto installer 😀
yet waiting for auto installer :d
the installation by default not support php –disable-dom , howto can i install it with –enable-dom ??
you need to install it from source if you wanna add your own configuration in ./configure section.
how to install mysqli
Add apache 2.4.1 🙂