From my NRCFOSS workshop drupal demo on a CentOS 5.2 host.
0. Logon to the Linux CentOS host from putty or any ssh client . You need to have root permissions on the box you are logging into. If you have root permissions granted to you by sudo then
sudo su - should do the trick. Or else su - and use root's password to change over to root user. Typically distributions might not allow root user to login remotely from ssh.
1. Get a DNS/hosts entry for hostname resolution pointing to the server where you want to create your site. Test it.
If you are only testing the drupal installation on your own machine or on a Virtual Machine on your machine then you only need to make entries into the respective hosts files of the both the Drupal-Host and the Desktop on which you are working. On a Linux machine add
to /etc/hosts
and on windows add it to notepad \system32\drivers\etc\hosts
Note: Windows Vista prevents you from directly editing your system files as an ordinary user so use the
runas Windows-Hostname\"" "notepad \system32\drivers\etc\hosts" instead.
2. a) Check if httpd,php,mysql and php-mysql packages are installed on your machine.
rpm -q httpd
rpm -q php
rpm -q mysql
rpm -q php-mysql
If any of the packages are not installed then install them using the yum command
yum install php mysql httpd php-mysql
Create a virtualhost(the sample VirtualHost config is already there in httpd.conf file normally found in /etc/httpd/conf folder on a RHEL/CentOS box) use a simple index.html file.
a) Sample Virtual Host Config
ServerAdmin
DocumentRoot /home//www
ServerName www.
ServerAlias
ErrorLog /home/aviral/logs/-error_log
CustomLog /home/aviral/logs/-access_log common
b) Locate the following in httpd.conf
Options FollowSymLinks
AllowOverride None
and change it to
Options FollowSymLinks
AllowOverride All
This is required for enabling .htaccess file that contains the configuration for clean urls in Drupal. Make sure apache/httpd user is able to access your VirtualHost's Document Root
3. Create a database and grant it permissions.
a) Logon to mysql as root using the following command
mysql -uroot -h -p
b) Create database
mysql>create database
c) Grant permissions to a mysql user which would be used by Drupal.
mysql> grant all on to @'%' identified by 'drupalpassword';
4. a) Download latest version of Drupal
wget http://ftp.drupal.org/files/projects/drupal-6.6.tar.gz
b) extract it
tar -zxvf drupal-6.6.tar.gz
c) Create a folder for your drupal installation
mkdir -p /home//www
d) copy over your drupal files
cp -r drupal-6.6/* /home//www/
and
.htaccess file
cp -r drupal-6.6/.htaccess /home//www/
d) Grant permissions for apache user to be able to access it
chmod 755 /home/
chown -R apache.apache /home//www/
5. Make sure the httpd and mysql services are started/restarted
/etc/init.d/httpd restart
/etc/init.d/mysql restart
and to check the status
/etc/init.d/httpd status
/etc/init.d/mysql status
If the status shows up as not running then check the errors for httpd in /var/log/httpd/error.log using
tail -f /var/log/httpd/error.log on another terminal.
MySQL errors are logged to an error file in /var/log/mysql.log again see any errors during a restart/start using
tail -f /var/log/mysqld.log
6. Add the services to the runlevels for restarting the next time
chkconfig --levels 2345 httpd on
chkconfig --levels 2345 mysqld on
7. Installation
a) Create a settings file required by installer
cp /home//www/sites/default/default.settings.php /home//www/sites/default/settings.php
chown apache.apache /home//www/sites/default/settings.php
chmod 777 /home//www/sites/default/settings.php
b) Run through drupal installation from your browser by pointing to the hostname of your site at http://
8. Install any missing dependencies as pointed out by the drupal web based installer.
9. Post installation
a) Enable cron job on Drupal host.
crontab -e to add the following line to your crontab file
5 * * * * /usr/bin/wget http:///cron
b) Enable blog and other optional modules under admin pages at
http:///admin/build/modules if you enabled clean urls during installation or clickthrough to
Administer->Site Building->Modules
10. Voila, make you can make your first blog post from
Create Content->Blog Entry
Remember to assign a friendly URL to your blog post.
Recent comments
8 weeks 1 day ago
8 weeks 1 day ago