This is my way of installing it, on an Ubuntu Linux 12.04 host.

  1. 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
  2. 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.
  3. 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/.
  4. 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.
  5. 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/
  6. Do an initial git commit:
    git add .
    git commit -m "Initial commit: Drupal 7 Social Commons 3.x."
  7. Install Drush locally. With Ubuntu multiverse repos enabled, execute:
    sudo apt-get install drush drush-make
  8. 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.
  9. Do another git commit:
    git add .
    git commit -m "After drush site-install."
  10. 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@localhost

            DocumentRoot /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 warn

            CustomLog ${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:

  11. 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
  12. 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 .
  13. Restart your Apache webserver:
    sudo service apache2 restart
  14. 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"
  15. 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

 

4 thoughts on “How to install Acquia Drupal Commons 7.0-3.x locally?

  1. This would have been an otherwise good article helping to install commons on linux but the assumption that everyone should already know what to do has made this article only appeal to high level people for example step Number 3 which is actually he first step is not clear enough to those who are not used to the language used and I am one of them … so eventually this has not beenuseful to me and I guess its same for many others… the main reason no one has made a comment.

    Would be good if you maybe did a video and explain every step clearly, what to type and where to type it

  2. Thanks for the remarks, Sen. I fear you need to go looking for a different set of instructions though. The above is just my personal log of how I did it, not a full-fledged tutorial. I put it online as there will be people who find it useful. Admittedly it requires a certain level of server administration savvyness (git, drush etc.).

  3. I didn’t understand the 5th step, it isn’t executing correctly. Can you help me?

    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/

  4. Adria, the two commands from step no. 5 that you quoted are just about getting rid of the commons-7.x-3.x-dev/ directory created when unpacking the archive. So, just move everything inside the commons-7.x-3.x-dev/ directory to your git repository directory, including the hidden files (those starting with a dot). You can use a file manager application for that job if the commands you quoted do not work for you.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>