Options Indexes FollowSymLinks MultiViews
AllowOverride All
Restart the Apache web server:
sudo /etc/init.d/apache2 restart
Installing Drupal 7
1. Start nautilus up with this command:
gksudo nautilus
...and navigate to the /var folder, right-click on the www folder, click 'Permissions' and set owner and group to your own user name. This will prevent problems with automatically created folders in the future.
2. Download and extract Drupal 7 from http://drupal.org/. Rename the folder to drupal7 and move it to /var/www/ where the web sites of the Apache web server reside. Result: /var/www/drupal7
3. Create the files folder, like this: /var/www/drupal7/sites/default/files. Right-click the 'files' folder, select 'Properties' -> 'Permissions' and under 'Others', set 'Folder Access' to 'Create and delete files'
4. Make a copy of the default.settings.php file in /var/www/drupal7/sites/default and rename it to settings.php. Right-click settings.php, select 'Properties' -> 'Permissions' and under 'Others', set 'Folder Access' to 'Create and delete files'
NOTE: Add an exception in Firefox, if you have disabled "Accept cookies from sites" and unblock the new site if you have a script blocker activated in your browser.
If all went well, you should now be able to enter http://localhost/drupal7 and install Drupal.
Setting up a virtual host
To set up a virtual host, allowing you to enter just http://drupal7/ in stead of http://localhost/drupal7/:
sudo gedit /etc/hosts
...and add:
127.0.0.1 drupal7
To define where the Apache web server should be looking for the files:
gksudo gedit /etc/apache2/httpd.conf
...and add:
DocumentRoot /var/www/drupal7
ServerName drupal7
As always, when you change the set up of the Apache server, restart it:
sudo /etc/init.d/apache2 restart
Move apache webroot from /var/www to your /home directory and move MySQL folder
For back up reasons and to have a more "normal" work flow when adding files to your web site, you can move the apache webroot from /var/www to /home/USERNAME/.www -- the .www folder will be hidden until you press Ctrl+H to unhide it:
gksudo gedit /etc/apache2/sites-available/default
Change DocumentRoot /var/www to DocumentRoot /home/USERNAME/.www
If you have set up a virtual host:
gksudo gedit /etc/apache2/httpd.conf
...and change to: DocumentRoot /home/USERNAME/.www
From http://gullele.wordpress.com/2010/08/27/changing-default-apache-webroot-in-ubuntu/
Likewise, to move MySQL from /var/lib/mysql to /home/USERNAME/.mysql follow this guide: http://ubuntuforums.org/showthread.php?t=897354
With Drush you can install modules and update Drupal from the command-line: http://drupal.org/project/drush
wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz
tar xvzf drush-6.x-3.3.tar.gz
sudo chmod 555 drush/drush
sudo chown -R root:root drush
sudo mv drush /usr/local/
sudo ln -s /usr/local/drush/drush /usr/local/bin/drush
sudo drush dl drush_make
If you get an "exec: 53: php: not found" error after running the last line ("sudo drush dl drush_make") you might have to install the PHP command line interface, with
sudo apt-get install php5-cli