Here is how to install Drupal on a CentOS 5.4 Linux installation, hosted on http://RimuHosting.com
- log in as root
Update to latest version with:
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime
apt-get update -y ; apt-get upgrade
- Install MySQL 5.0
MYROOTPW=xxxxxx
apt-get -y install mysql mysql-server
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
mysqladmin -u root password $MYROOTPW
- Install Apache2
apt-get -y install httpd
chkconfig --levels 235 httpd on
/etc/init.d/httpd start
echo "<html><head><title>Server</title></head><body><h1>Name of Server</h1></body></html>" > /var/www/html/index.html
change AllowOverride to All in first two places to enable .htaccess
vi /etc/httpd/conf/httpd.conf
Visit http://severname.com to check apache is working
- Install PHP5
apt-get -y install php
change memory_limit = 40M, post_max_size = 40M, upload_max_filesize = 20M
date.timezone = America/Toronto
vi /etc/php.ini
/etc/init.d/httpd restart
echo "<?php phpinfo(); ?>" > /var/www/html/testphp.php
And try visiting servername.com/testphp.php
- Add mysql support for php
apt-get -y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc mod_auth_mysql mysql-server php-mbstring
/etc/init.d/httpd restart
- Install phpMyAdmin (for 32bit use i386 instead of x86_64)
ARCH=i386 #or x86_64
VER=0.5.1-1
SITE=http://packages.sw.be/rpmforge-release
wget $SITE/rpmforge-release-$VER.el5.rf.$ARCH.rpm
rpm -Uvh rpmforge-release-$VER.el5.rf.$ARCH.rpm
yum install phpmyadmin
Configuration so that phpMyAdmin allows connections not just from localhost by commenting out the block <Directory "/usr/share/phpmyadmin">
vi /etc/httpd/conf.d/phpmyadmin.conf
Change the authentication in phpMyAdmin from cookie to http by editing the following line:
vi /usr/share/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http';
/etc/init.d/httpd restart
Or you can install phpmyadmin from a rimu script:
wget "http://proj.ri.mu/installphpmyadmin.sh"
bash installphpmyadmin.sh
- webmin is already installed at https://servername.com:10000 but log in and apply any upgrades.
You will need to un-comment the NameVirtualHost *:80 line:
vi /etc/httpd/conf/httpd.conf
- Create Drupal database user
DRUSR=drupalusername
DRPW=mylongdrupalpassword
echo "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON *.* TO '$DRUSR'@'localhost' IDENTIFIED BY '$DRPW';" | mysql -u root --password=$MYROOTPW
- Download and install Drupal following the instructions here: http://drup.org/acquia-drupal-svn
Use webmin to create more virtual servers, but the first virtual server created will become the default, so make it point to /var/www/html with a servername of something like sv.mysite.org
See http://rimuhosting.com/howto/virtualhosting.jsp for more details
- Install APC (optional)
yum -y install php-pear php-devel httpd-devel
pecl install apc
#answer yes to question
echo "extension=apc.so" > /etc/php.d/apc.ini
#optionally modify cache size: apc.shm_size="64"
/etc/init.d/httpd restart
cp /usr/share/pear/apc.php /var/www/html # and visit apc.php to test it is working
cp /usr/share/php/apc.php /var/www/html # it may be here instead
- Well done! You are finished
This guide is based on information from here: http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support...