Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.

26
Drupal Drupal Jumpstart Jumpstart Information Systems 337 Information Systems 337 Prof. Harry Plantinga Prof. Harry Plantinga

Transcript of Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.

Drupal JumpstartDrupal Jumpstart

Information Systems 337Information Systems 337

Prof. Harry PlantingaProf. Harry Plantinga

Lab 5 DebriefLab 5 Debrief

Understand HTTP?Understand HTTP?

Difference between GET and POST for forms Difference between GET and POST for forms action?action?

Did any crawler visit your site? Implications?Did any crawler visit your site? Implications?

Cookies – how to set with <meta> element?Cookies – how to set with <meta> element?

Lab 6—Drupal Lab 6—Drupal JumpstartJumpstart

In Lab 6 you'll be installing and configuring In Lab 6 you'll be installing and configuring PHP, MySQL, and DrupalPHP, MySQL, and Drupal

Most remaining labs – continue to configure Most remaining labs – continue to configure your Drupal website. your Drupal website.

We'll have two website running on systems We'll have two website running on systems lab servers:lab servers: yourID-dev.calvincs.comyourID-dev.calvincs.com yourID-lab.calvincs.comyourID-lab.calvincs.com

A few things you'll need to know…A few things you'll need to know…

PHPPHP

What is PHP?What is PHP?

If PHP is not already installed, you'll be If PHP is not already installed, you'll be installing it on your serverinstalling it on your server

PackagesPackages Php5, php5-cli, php5-mysqlPhp5, php5-cli, php5-mysql

MySQLMySQL

Open-source, free Database serverOpen-source, free Database server

Most popular database server, especially for Most popular database server, especially for websiteswebsites

Your website will connect to MySQL, store all its Your website will connect to MySQL, store all its data theredata there

You'll need to issue some common commandsYou'll need to issue some common commands Create databasesCreate databases Create logins with appropriate privilegesCreate logins with appropriate privileges Make backupsMake backups

mysqldump -u login –p databasename > mysqldump -u login –p databasename > filename.sqlfilename.sql

Installing DrupalInstalling Drupal

How to download and install files in Linux?How to download and install files in Linux? apt-get, etcapt-get, etc Download, unpack, install manuallyDownload, unpack, install manually

wget, tar, mvwget, tar, mv

How to see or move files like ".htaccess"?How to see or move files like ".htaccess"?

Who should own the files of your website? Who should own the files of your website? Why? Why?

How to change the owner of a file? How to change the owner of a file?

How…How…

……would you design a content management would you design a content management system?system?

What does it have to do?What does it have to do?

How to install modules, themes?How to install modules, themes?

Drupal File LayoutDrupal File Layout

Drupal file layoutDrupal file layout index.phpindex.php modulesmodules themesthemes sitessites

sites/prepsoccer.org/settings.phpsites/prepsoccer.org/settings.php sites/all/themessites/all/themes sites/all/modulessites/all/modules

How does drupal get "started" when you How does drupal get "started" when you access a server, e.g. prepsoccer.org?access a server, e.g. prepsoccer.org?

What directory should all of this stuff go in?What directory should all of this stuff go in?

ThemesThemes

How to select a theme?How to select a theme? Layout you want (columns, menus, slogan, etc)Layout you want (columns, menus, slogan, etc) Menu structure you wantMenu structure you want Version compatibleVersion compatible Fixed vs. liquidFixed vs. liquid

InstallInstall

ConfigureConfigure

Make it default (only?)Make it default (only?)

Installing a ThemeInstalling a Theme

How?How?

Virtual HostsVirtual Hosts

Can configure multiple domain names to refer to Can configure multiple domain names to refer to the same IP addressthe same IP address

Web requests arrive with hostname in headerWeb requests arrive with hostname in header

Your server can run different sites for different Your server can run different sites for different hostnames (/etc/apache2/sites-enabled)hostnames (/etc/apache2/sites-enabled)

Configure drupal for multiple sites Configure drupal for multiple sites (/var/www/sites)(/var/www/sites) Can optionally share filesystem, databaseCan optionally share filesystem, database We'll run two per student on the system lab servers:We'll run two per student on the system lab servers:

yourlogin-dev.calvincs.comyourlogin-dev.calvincs.com yourlogin-lab.calvincs.comyourlogin-lab.calvincs.com

More Tidbits (Lab 7)More Tidbits (Lab 7)

Hostname, /etc/hostnameHostname, /etc/hostname

Mail service, postfixMail service, postfix

PHP memory requirementsPHP memory requirements

Cron, crontabCron, crontab See /etc/crontab, cron.hourly, cron.daily, etcSee /etc/crontab, cron.hourly, cron.daily, etc Edit with sudo crontab –eEdit with sudo crontab –e Add something like this:Add something like this:

7 * * * * /usr/bin/wget 7 * * * * /usr/bin/wget http://yoursite.com/cron.phphttp://yoursite.com/cron.php

Drupal OverviewDrupal Overview

ThemesThemes

ModulesModules

MenusMenus

BlocksBlocks

Content typesContent types

RolesRoles

ModulesModules

What do you use modules for?What do you use modules for?

How to find, select?How to find, select?

How, where to install?How, where to install?

ConfigurationConfiguration

Effects on performance, usabilityEffects on performance, usability

MenusMenus

PrimaryPrimary e.g. Home, Standings, Forum, e.g. Home, Standings, Forum,

StoreStore Typically top of the pageTypically top of the page My be hierarchicalMy be hierarchical

SecondarySecondary e.g. About, Contact us, Log out, Terms of Service, e.g. About, Contact us, Log out, Terms of Service,

Privacy PolicyPrivacy Policy

NavigationNavigation All of the tasks you can doAll of the tasks you can do May not be displayed for unauthenticated usersMay not be displayed for unauthenticated users

ConfigurationConfiguration Set location, visibility in theme (or blocks)Set location, visibility in theme (or blocks)

BlocksBlocks

Modules present their Modules present their information information as 'blocks'as 'blocks'

You configure what blocks go You configure what blocks go where, on which pageswhere, on which pages

This is the primary means of This is the primary means of configuring the functionality of configuring the functionality of your websiteyour website

UsersUsers

Creating loginsCreating logins

User SettingsUser Settings Registration optionsRegistration options Text of emails that Drupal sendsText of emails that Drupal sends Signature, picture supportSignature, picture support

ProfilesProfiles Each user has a profile pageEach user has a profile page Use the Profile module to customize contentsUse the Profile module to customize contents

RolesRoles

For PrepSoccer.org:For PrepSoccer.org: administrator administrator (can do everything)(can do everything) team manager team manager (can update scores and schedule, (can update scores and schedule,

add games, post photos, stories and comments)add games, post photos, stories and comments) authenticated user authenticated user (can post photos, stories, and (can post photos, stories, and

comments)comments) unauthenticated user unauthenticated user (can read anything and (can read anything and

change nothing)change nothing)

In DrupalIn Drupal Configure with User Management -> Roles, Configure with User Management -> Roles,

PermissionsPermissions

What if site is down?What if site is down?

Debugging is a key skill…Debugging is a key skill…

How to debug your site?How to debug your site? What part is malfunctioning?What part is malfunctioning?

Is server running and connected to the Internet?Is server running and connected to the Internet? Is webserver running?Is webserver running? Is database server running?Is database server running?

Web server logs are your friendsWeb server logs are your friends /var/log/apache2/var/log/apache2

Content TypesContent Types

Create a content type for every type of 'thing' Create a content type for every type of 'thing' on your website (blog post, story, newsletter, on your website (blog post, story, newsletter, photograph, calendar entry, bulletin, team, photograph, calendar entry, bulletin, team, game result, …)game result, …)

Add and configure custom content typesAdd and configure custom content types

Add custom ways for displaying content typesAdd custom ways for displaying content types

To add content, use Create Content -> …To add content, use Create Content -> …

Adding Content TypesAdding Content Types

Default content typesDefault content types PagePage: Intended for static content such as : Intended for static content such as

“About Us”“About Us” StoryStory: Intended for content that will be : Intended for content that will be

frequently posted, such as news articlesfrequently posted, such as news articles

You can add content types in various waysYou can add content types in various ways Add a module, e.g. Add a module, e.g. BlogBlog, that adds a content , that adds a content

typetype Create your own custom content typesCreate your own custom content types

When should I use When should I use Story vs. Blog?Story vs. Blog?

Blog module addsBlog module adds ““blog” content typeblog” content type overview of all blog posts at /blogoverview of all blog posts at /blog overview of each blogger’s posts at /blog/3overview of each blogger’s posts at /blog/3 links at the bottom of each blog post to the links at the bottom of each blog post to the

author’s other blog postsauthor’s other blog posts filtered RSS feed for blogger’s postsfiltered RSS feed for blogger’s posts a private “my blog” link in the navigation menu a private “my blog” link in the navigation menu

for each user who has permission to create blog for each user who has permission to create blog postsposts

StoriesStories

We want users who don’t know HTML to be We want users who don’t know HTML to be able to add game stories, event updates, etcable to add game stories, event updates, etc Install Install FCKeditor

We want to be able to We want to be able to include images in the include images in the game storiesgame stories Install Install IMCE

CommentsComments

Users (with permission) can add comments to Users (with permission) can add comments to pagespages

Spam vs. Ham?Spam vs. Ham? MollomMollom

Auto-delete spam identified by stats of millions of Auto-delete spam identified by stats of millions of other blots’ contentother blots’ content

Also blocks spam in contact form, nodes, user Also blocks spam in contact form, nodes, user registration forms, etc.registration forms, etc.

Displays captcha in questionable casesDisplays captcha in questionable cases Can also delete low-quality, abusive content Can also delete low-quality, abusive content

(flames)(flames)