Submitted by jean-paul on Thu, 06/06/2013 - 01:26

Here is my basic procedure for setting up a new Drupal site. I'm using Drupal 7.## and my server configuration may vary from yours, so these might not be appropriate instructions for everyone. Also, don't use the links. They're just examples!

  • change to DocumentRoot container (I symlink from /var/www to each site's folder).
  • wget http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz and untar.
  • mv drupal-#.## newsitename
  • sudo ln -s /path/to/DocRootContainer/newsitename /var/www/
  • sudo cp /etc/apache2/sites-available/template /etc/apache2/sites-available/newsitename
  • sudo vim /etc/apache2/sites-available/newsitename  -->(basically I just have to set the ServerName, DocumentRoot, Directory, CustomLog and ErrorLog directives.)
  • sudo chown -R www-data.myusername /path/to/DocRootContainer/newsitename
  • log in to phpmyadmin and create a new user with privileges on a new database
  • sudo a2ensite newsitename
  • sudo vim /var/www/newsitename/.htaccess  -->(Enable forwarding of www.newdomainname.com to newdomainname.com, which reduces "duplicate" content hits by web-crawlers)
  • sudo service apache2 restart
  • add entry to /etc/hosts  -->(point domain to ip until the site is ready to go live, at which point an A-Record is created at my domain registrar for the site.
  • go to the site, and follow the prompts to complete the install.
  • profit

Let me know if I've missed something critical!