This is my way of installing it, on an Ubuntu Linux 12.04 host.
- Make sure you meet the installation requirements of Drupal 7 (as per its INSTALL.txt). The simplest set of alternatives:
- Apache 2.0 or greater
- PHP 5.2.4 or greater
- MySQL 5.0.15 or greater
- Create a directory where you want your Drupal installation to reside. It does not have to be below your /var/www/ document root, we'll sort that out.
- Switch to the directory you just created and create an empty local git repository in it by calling:
git init
. The repository is created in ./.git/. - Download the latest version for Drupal 7 from the Drupal Commons project website. In my case it was the 7.x-3.x-dev pre-release version dating 2012-12-21.
- Unpack the Drupal Commons package into your git repo directory:
tar -xzf ../commons-7.x-3.x-dev-core.tar.gz
mv commons-7.x-3.x-dev/* commons-7.x-3.x-dev/.gitignore commons-7.x-3.x-dev/.htaccess .
rmdir commons-7.x-3.x-dev/
- Do an initial git commit:
git add .
git commit -m "Initial commit: Drupal 7 Social Commons 3.x."
- Install Drush locally. With Ubuntu multiverse repos enabled, execute:
sudo apt-get install drush drush-make
- Create the working Drupal site with Drush. Enter the directory of your Drupal installation and execute:
drush site-install standard --db-url=mysql://dbuser:dbpassword@localhost:port/dbname --db-su=root-user --db-su-pw=root-password --site-name="Your Site Name"
In there, replace root-user with your MySQL superuser user name (normally admin) and root-password with its password. Giving that information enables Drush to create the database you want to use for teh Drupal installation and gave via dbuser, dbpassword, port and dbname. - Do another git commit:
git add .
git commit -m "After drush site-install."
- Make the Drupal 7 site accessible on your local Apache webserver.
sudo vi /etc/apache2/sites-available/your-site-name
Add the following content and save it:<VirtualHost *:80>
ServerAdmin webmaster@localhostDocumentRoot /home/user/path/to/your/site
ServerName your-site-name.localdomain<Directory /home/user/path/to/your/site/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warnCustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Then execute, to enable this site:
cd /etc/apache2/sites-enabled/;
sudo ln -s ../sites-available/edgeryders ../sites-enabled/001-edgerydersRestart your Apache:
- Add name resultion for your new site. In this case, we simply use the hosts file. Just add the following line to /etc/hosts, in accordance to the domain name you chose for the Apache configuration above:
127.0.0.1 your-site-name.localdomain - Make sure mod_rewrite is enabled in your Apache webserver. (It is expected by Drupal 7 by default, and if not loaded, all POST forms will not work but with no error message, so even login will not work then. See Drupal issue 932636.) To enable it, execute:
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/rewrite.load .
- Restart your Apache webserver:
sudo service apache2 restart
- Reset your Drupal admin user's password (since I could not find out which one Drush uses when creating that user):
drush user-password admin --password="some-password"
- Access your site and log in as user "admin" with the password you have just set. Just access this URL, in accordance to how you configured your domain name in your Apache config:
http://your-site-name.localdomain
Leave a Reply