You are here

Installing Drupal on RimuHosting.com

Here is how to install Drupal on a CentOS 5.4 Linux installation, hosted on http://RimuHosting.com

  1. 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

  2. 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

  3. Install Apache2 & postfix
    You may have to add this line to /etc/sysconfig/iptables BEFORE any reject lines (e.g. after the port 22 ACCEPT)
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
    service iptables restart #and then restart 
    apt-get -y install httpd postfix
    chkconfig --level 35 postfix on
    /etc/init.d/postfix start
    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
  4. 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
  5. 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

  6. 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

  7. 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

  8. Create Drupal database user
  9. 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

  10. Download and install Drupal following the instructions here: http://drup.org/acquia-drupal-svn
  11. 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

  12. Install APC (optional)
  13. yum -y install php-pear php-devel httpd-devel
    yum -y install php-pecl-apc
    #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
    ln -sfn `find /usr -name "apc.php"` /var/www/html/ # or use more of a brute force method
    

  14. Well done! You are finished
  15. If you upgrade your version of php, *you will have to re install apc*

This guide is based on information from here: http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support...