|
|
|
|
|
Submitted by Andrew on Sat, 10/06/2007 - 02:37
|
Here is how to install Drupal on a Centos5 Linux installation
- Install Centos5 including web server and mysql
- log in as root
- Update to latest version with:
yum -y update yum ; yum -y update
- Install modules with:
yum -y install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel system-config-securitylevel-tui
Note that this is called system-confi-firewall in CentOS 6
- Enable .htaccess:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.original vi /etc/httpd/conf/httpd.conf and in two places change AllowOverride None to All (may not be needed in CentOS 6
- Uncomment
NameVirtualHost *:80
- Start apache with:
service httpd start
- Run:
system-config-securitylevel-tui and enable firewall for ssh and http, plus port 10000 for webmin
- Open a browser window pointed to the server to check if apache is running
- Create default page:
echo "<html><head><title>Name of Server</title></head><body><h1>Name of Server</h1></body></html>" > /var/www/html/index.html
- Make sure server is running by visiting:
http://servername/
- Create test script:
echo "<html><head><title>Test Page</title></head><body><?php phpinfo(); ?></body></html>" > /var/www/html/testphp.php
- Make sure php is running by visiting:
http://servername/testphp.php
- download and install webmin:
WMVER=1.630-1
wget http://prdownloads.sourceforge.net/webadmin/webmin-$WMVER.noarch.rpm
rpm -U webmin-$WMVER.noarch.rpm
system-config-firewall #to open port 10000
- Check it is working by visiting:
http://servername:10000
- Use webmin to create a virtual server at /var/www/html with no server name. (This will be the default and must come first)
- Install MySQL with:
yum -y install php-mysql mod_auth_mysql mysql-server php-gd php-mbstring
- Start MySQL:
/etc/init.d/mysqld start
- Now setup MySQL:
mysqladmin -u root password rootsqlpassword
- Make sure mysqld and httpd start on boot by checking the boxes:
webmin / system / bootup and shutdown
- Download and install Drupal following the instructions here: http://drup.org/acquia-drupal-svn
- Well done! You are finished
Saving memory
- You can save some memory by disabling the following Apache modules by renaming their .conf files in /etc/httpd/conf.d
manual, perl, proxy_ajp, python, squid, webalizer
- I saved some more memory by disabling the following services using webmin
avahi-daemon, gpm, haldaemon, hidd, irqbalance, mdmonitor, netfs, nfslock, pcscd, yumupdatesd
Optional Extras
- Install subversion
yum install subversion
- Download and install phpmyadmin:
wget "http://proj.ri.mu/installphpmyadmin.sh"
bash installphpmyadmin.sh
- you may wish to disable selinux for httpd
setsebool -P httpd_disable_trans 1
service httpd restart
- for useful notes, see: http://www.howtoforge.com/perfect-server-centos-5.2
Install php 5.2 and APC
cd /etc/yum.repos.d
wget http://dev.centos.org/centos/5/CentOS-Testing.repo
pecl uninstall apc #in case it was installed
yum -y --enablerepo=c5-testing update php*
service httpd restart
#
# to install APC
#warning: backup your httpd.conf file first, as this may overwrite it
yum -y install gcc httpd-devel
yum -y --enablerepo=c5-testing install php-devel php-pear
pecl -d memory_limit=16M install apc
echo "extension=apc.so" > /etc/php.d/apc.ini
service httpd restart
cp /usr/share/php/apc.php /var/www/html # and visit apc.php to test it is working
cp /usr/share/pear/apc.php /var/www/html # it may be here instead
- useful link: http://www.agileapproach.com/blog-entry/howto-install-pecl-apc-cache-centos-without-xampp
- Install apc based on: http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html
yum install -y php-pear php-devel httpd-devel
pecl install apc
echo "extension=apc.so" > /etc/php.d/apc.ini
service httpd restart
- To install PHP 5.2, see: http://bluhaloit.wordpress.com/2008/03/13/installing-php-52x-on-redhat-es5-centos-5-etc/
As an alternative to installing php 5.2, it is possible to keep 5.1.6 and still install json and apc:
http://maisonbisson.com/blog/post/12137/json-rhel-centos-php-516/
http://maisonbisson.com/blog/post/12589/installing-php-apc-on-rhel-centos/
CentOS 6
Command line config of ports by installing system-config-firewall
Then configure services with ntsysv
|
|
|
|
|
|
|