Drupal 7 Install on CentOS 6

# Needed stuff
yum install -y httpd php mysql mysql-server php-gd php-mbstring php-xml php-mysql wget man php-pecl-apc php-pear php-devel httpd-devel gcc make pcre-devel

pecl install uploadprogress
vi /etc/php.ini
	extension=uploadprogress.so

# MySQL setup
service mysqld start
chkconfig mysqld on
mysql_secure_installation

useradd -s /bin/bash -m drupal
usermod -a -G apache drupal
passwd drupal
chown drupal:apache /var/www/html/

mysql -u root -p

  CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'yourPass1';

  CREATE DATABASE drupal;

  GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `drupal`.* TO 'drupal'@'localhost';

  FLUSH PRIVILEGES;

  QUIT

# Httpd setup
chkconfig httpd on

setsebool -P httpd_can_network_connect 1

# Drupal install/config
wget http://ftp.drupal.org/files/projects/drupal-7.38.tar.gz # Get latest
tar -xzf drupal-7.38.tar.gz -C /var/www/html/ --strip=1
chown -R drupal:apache /var/www/html/{*,.??*}

cp -ax /var/www/html/sites/default/default.settings.php /var/www/html/sites/default/settings.php

chmod g+w /var/www/html/sites/default/settings.php	# Writeable for web config

vi /var/www/html/sites/default/settings.php		# I use a proxy
	$conf['proxy_server'] = '12.34.56.78';
	$conf['proxy_port'] = 8080;

mkdir /var/www/html/sites/default/files/
chgrp apache /var/www/html/sites/default/files/
chmod 2775 /var/www/html/sites/default/files/

service httpd start

    http://yoursite.com/				# Web Config Site

chmod g-w /var/www/html/sites/default/settings.php	# Harden permissions

yum install -y php-pear pear channel-discover pear.drush.org pear install drush/drush cd /var/www/html/sites/ drush up
# Composer / Drush install yum install -y git curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer vi ~/.bashrc export PATH=/root/.composer/vendor/bin:$PATH composer global require drush/drush:6.*
# Patch somesite.com cd /var/www/html/sites/somesite.com/ drush up drush cc all
# Configure Drush to update disabled modules cd /var/www/html/ drush vset update_check_disabled 1 -y
Backups with Drush
cd /var/www/html/ [sites/] drush archive-dump # Base drush archive-dump @sites # Everything drush archive-dump site1.nz,site2.nz # Sites # Files in /root/drush-backups/archive-dump/
Restore with Drush
drush archive-restore /root/multiple_sites.20150615_202243.tar.gz # Everything drush archive-restore ./example.tar.gz example.com # site, DB+files
# Install Site modules for somesite.com # Modules end up in: /var/www/html/sites/somesite.com/modules/ cd /var/www/html/sites/somesite.com/ drush dl context [...] drush en -y context context_ui [...] drush cc all # Install Global modules # Modules end up in: /var/www/html/sites/all/modules/ cd /var/www/html/ drush dl context [...] drush en -y context context_ui [...] drush cc all

drush updatedb

This will run any pending database updates. This is normally required if you update module code and that module needs to update the database. This saves you from running updates via update.php


Drush autodetects the appropriate site from directory context, and read its configs from there, so if your command shell is in {drupaldir}/sites/all or anywhere under {drupaldir} then drush commands will apply to your default install. If you move your shell session into {drupaldir}/sites/mysite, then drush commands will be run in the context of the mysite multisite instance. You can always run drush status to check the currently active context.
# For CMSTEST
yum install http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install php-soap php-imap php-ldap php-mcrypt php-odbc php-xmlrpc