Installing Drupal on CentOS 5/Red Hat/Fedora
Last modified: April 8, 2009 - 01:36
This is a general description of how to install Drupal on a Linux CentOS/RedHat/Fedora server with root access. Your mileage might vary somewhat depending on your particular environment.
Comments on various CentOS/RedHat/Fedora combinations and set ups are most welcome in this section. This is based on a CentOS 5/RedHat installation. Comments that only concern Fedora should be added to and not displace CentOS/RedHat information.
- Upgrade the operating system
yum update - Install common programs
yum install php mysql-server php-mysql php-mbstring php-gd - Download and install Webmin (optional)
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.440-1.noarch.rpm
wget http://webmin.com/jcameron-key.asc
rpm --import jcameron-key.asc
yum install webmin-1.440-1.noarch.rpm - Reboot
- Login to webmin through your browser. On a virtual host, how to do so may be non-obvious, but your host should provide details somewhere in the documentation of how to access your host through a url.
- In webmin, go to "Bootup and Shutdown" and enable the httpd and mysqld daemons.
- Create a new user. I made the home directory "/var/www/html" and the shell "/bin/bash".
- Edit the httpd.conf file. I did this through webmin in the "Apache Webserver" section by clicking on the "Global configuration" tab and then going to "Edit config files". Change the line "Options Indexes FollowSymLinks" to "Options Includes FollowSymLinks" or even something more liberal.
While you are there, go to the following section:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None"Change "AllowOverride None" to "AllowOverride All" if you want clean urls.
- In webmin, go to "Apache Webserver" and create a virtual host if you want to host multiple hosts on the same server instance.
- Create a new empty database in mysql. I did this through webmin. You should also add passwords for the root mysql user as well as a regular user for security reasons.
- In my case, I changed the permissions of /var/www/html to my user and the apache group.
chown -R myuser /var/www/html
chgrp -R apache /var/www/html - Get Drupal and unpack it in the /var/www/html/ directory or if you are using virtual hosts in /var/www/html/example.com
wget http://ftp.drupal.org/files/projects/drupal-6.6.tar.gz
tar -xzvpf drupal-* --strip-components=1
cp ./sites/default/default.settings.php ./sites/default/settings.php - If you want a "files" directory for file uploads, do the following in your Drupal root directory
mkdir ./sites/default/files - The following permissions should allow you complete access to Drupal though your regular user account except for the ./sites/default folder which should be set to a Drupal's default upon install.
chgrp -R apache .
chown -R apache ./sites/default
chgrp -R myuser ./sites/default
chmod -R g+w sites/default - Reboot
- Install Drupal as normal by going to the url of your home page

Install Apache
You didn't include instructions to setup Apache.
yum install httpd mod_ssl
Cheers!!!
-Anil
Step #7
"Create a new user. I made the home directory "/var/www/html" and the shell "/bin/bash"."
Hello,
I am quite new to Linux.
I don't understand step #7.
What kind of user am I supposed to create and how? Do I do this in Webmin? Command line?
Please advise...
Thanks very much.
Answer
I am going to answer my own question, please correct me if I am wrong.
In Webmin...
Click "System" on the left column.
Click "Users and Groups"
Click "Create New User"
Don't have permission to access localhost/drupal-6.14
I had already done every step here at this node 327731 but I am having this kind of problem: You don't have permission to access /drupal-6.14/ on this server. By the way, I am using Fedora 12, Apache 2.2.13, PHP 5.3.1 and MySQL 5.1
Please help. Thank you very much.
Michael Angelo Samson
MCP ID 6607942
http://masamsonpc.farvista.net