Last updated April 8, 2009. Created by lhtown on October 29, 2008.
Edited by bekasu. Log in to edit this page.
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
Comments
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
I got there in the end
First timers may want to be particularly careful when reading and executing these instructions. I made a few mistakes during my initial installation and had to start all over again, failing to find where I had gone wrong before.
I suggest that once you have downloaded the Drupal package, read the file 'install.txt' to cross-reference it with this tutorial. This method was what worked for me (using Fedora 12).
This is otherwise a very useful walk-through for both Drupal and Webmin newcomers.
Thanks.
N00B today... N00B tomorrow.
If you get a 403 Forbidden
If you get a 403 Forbidden page error after following these instructions... check out http://drupal.org/node/557910
Best Regards,
Mark Rozencwajg
Fixes for PHP 5.3
Because of php 5.3, we need to fix a few things:
If back up and migrate fails, need date.timezone = "Europe/London" in php.ini.
You will need to update to the dev module versions of admin_menu calendar date, lots of thread on these 3 issues so won't elaborate.
S:)
Senior Drupal Web Developer
Wellcome Trust Sanger Institute
PHP 5.2 and 5.3 on CentOS/RHEL
RHEL/CentOS is fairly notorious for coming with older versions of PHP. Since we mostly want PHP 5.2 (or possibly 5.3) for Drupal 6, and 5.3 for Drupal 7, there are a couple of repositories that can be used to get a reasonable PHP version.
To get PHP 5.2, use the jasonlitka.com repository. Follow the instructions listed, but you will probably want to add a line to the bottom of the suggested .repo file that says
includepkgs=php*so that only the PHP packages are affected.For PHP 5.3, the Remi repository is highly thought off. Again, you may want to add
includepkgs=php*.After installing the .repo files, you can
yum updateTwo-part blog post - Installation with screenshots / code sample
I just stumbled on this article from the RedHat/CentOS group and would like to offer a couple of succinct blog posts I wrote in Nov. 2009 when I was getting into Drupal and setting up a server...
http://pragmatic-software.blogspot.com/2009/11/preparing-centos-53-lamp-...
http://pragmatic-software.blogspot.com/2009/11/preparing-centos-53-lamp-...
Fedora 14 specific instructions
I spent the last several days doing Fedora 14 installs of Drupal 7 on PostgreSQL. I banged out the basic instructions starting from a minimal system with an SELinux Enforcing policy active and iptables blocking everything not necessary for Drupal to run. I didn't provide much explanation (sorry, just no time yet), but researching the details on the net should be easy:
http://zxq9.com/archives/442
I am pretty sure these instructions will work (almost?) unmodified on CentOS 5/6 and RHEL 5/6 as well as Fedora 15, though I've been too lazy to test it there as well. This is a bit more strict server-side oriented, so it assumes absolutely nothing is installed on the system (make and gcc aren't even installed yet, but they will be when you're done).
If I kajiggered anything or put something out of order, please let me know -- I tried to streamline it just short of turning it into a script (which at this point would be relatively effortless...).