From popdata
Jump to: navigation, search

Setting up a new Drupal Website

  • Add the site to apache config
    • create a file in /etc/apache2/sites-available like this:
<VirtualHost *:80>

    DocumentRoot /var/www/popdata/drupal
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/popdata/drupal/>
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        Options FollowSymLinks MultiViews ExecCGI
        AllowOverride None
        Order allow,deny
        allow from all

    LogLevel warn
    ErrorLog /var/log/apache2/wwwdev-error.log
    CustomLog /var/log/apache2/wwwdev-access.log combined
    ServerSignature On
    • enable the site: a2ensite popdata-wwwdev
    • reload apache: /etc/init.d/apache2 reload
  • create the drupal site:
cd /home/www/popdata/drupal/sites
mkdir files
chown www-data files
  • create the database and user
create database wwwdev;
GRANT ALL ON wwwdev.*  TO 'wwwdev'@'localhost' IDENTIFIED BY 'secret';
  • put mysql info line into the settings file

$db_url = 'mysqli://wwwdev:secret@localhost/wwwdev';
  • go to the site:
  • fill in the database name, db user and password
  • fill in the rest of the info, save the admin user and password

Copy production to test for

cd /home/www/popdata/drupal/sites
  • copy the physical site
mv wwwtest.old
cp -a
cp wwwtest.old/settings.php
  • copy the database
mysqldump -p wwwdev > wwwdev.sql
mysql -p wwwtest < wwwdev.sql
  • copy the theme
cd /home/www/popdata/drupal/sites/all/themes
mv pdbctest ~jim/pdbctest.old
cp -a pdbc pdbctest
cd pdbctest
  • edit change:
    • name = pdbctest
    • project = "pdbctest"
  • copy old image
cd /home/www/popdata/drupal/sites/all/themes/pdbctest/images/logo
cp ~jim/pdbctest.old/images/logos/pdbcLogo.gif .
  • go to admin
  • go to Administer->Site Building->Themes
  • enable pdbctest theme
  • edit page-default.tpl.php and remove the line with getRandomImage (but save it)
  • click on Administer->Site Building->Blocks
  • edit the blocks layout to be the same as production
  • edit page-default.tpl.php and put back the line with getRandomImage
  • go to Administer->Site Building->Blocks
  • configure the Nice Menus 1
  • change the block title from "<none>" to ""
  • save block
  • change the block title from "" to "<none>"
  • edit "home" page to make a visible difference