Services/drupal

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>
    ServerAdmin webmaster@popdata.bc.ca
    ServerName wwwdev.popdata.bc.ca

    DocumentRoot /var/www/popdata/drupal
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <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
    </Directory>

    LogLevel warn
    ErrorLog /var/log/apache2/wwwdev-error.log
    CustomLog /var/log/apache2/wwwdev-access.log combined
    ServerSignature On
</VirtualHost>
    • enable the site: a2ensite popdata-wwwdev
    • reload apache: /etc/init.d/apache2 reload
  • create the drupal site:
cd /home/www/popdata/drupal/sites
mkdir www.openhealthpolicy.ca
cd www.openhealthpolicy.ca/
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: http://wwwdev.popdata.bc.ca/
  • 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 www.popdata.bc.ca

cd /home/www/popdata/drupal/sites
  • copy the physical site
mv wwwtest.popdata.bc.ca wwwtest.old
cp -a www.popdata.bc.ca wwwtest.popdata.bc.ca
cp wwwtest.old/settings.php wwwtest.popdata.bc.ca
  • 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
mv pdbc.info pdbctest.info
  • edit pdbctest.info 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 http://wwwtest.popdata.bc.ca/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