Web Development and Deployment Best Practices

Development and
Development and
Deployment
Deployment
Information Systems 337
Information Systems 337
Prof. Harry Plantinga
Prof. Harry Plantinga
Developing and Deploying
Developing and Deploying
 
These lab VMs will be going away after the
These lab VMs will be going away after the
semester ends
semester ends
How will you deploy the site?
How will you deploy the site?
How will you save the source code so that you or
How will you save the source code so that you or
others can work on it later?
others can work on it later?
Site Maintenance
Site Maintenance
 
Your web site is up and running, and people are
Your web site is up and running, and people are
using it
using it
You want to change a page
You want to change a page
You edit the page.tpl.php file. Syntax error! Site goes
You edit the page.tpl.php file. Syntax error! Site goes
down!
down!
You can't remember how to fix it. Site stays down!
You can't remember how to fix it. Site stays down!
You have two people editing the same file. Site down!
You have two people editing the same file. Site down!
Work lost!
Work lost!
 
What to do?
What to do?
Development Strategies
Development Strategies
You will need live and development sites
You will need live and development sites
Devel site on your own VM
Devel site on your own VM
Deploy site on calvincs.com
Deploy site on calvincs.com
Live site on client’s dreamhost account
Live site on client’s dreamhost account
Ideally: one-button deployment
Ideally: one-button deployment
Deployment
Deployment
Deployment means uploading your site (www directory,
Deployment means uploading your site (www directory,
databases) to a host
databases) to a host
Host must support PHP, MySQL, etc.
Host must support PHP, MySQL, etc.
Next lab: deployment on dreamhost (calvincs.com).
Next lab: deployment on dreamhost (calvincs.com).
Other hosts – same idea, different details
Other hosts – same idea, different details
Load your database onto their server
Load your database onto their server
Use FTP to load your /var/www/ directory onto their
Use FTP to load your /var/www/ directory onto their
server
server
Adjust configuration…
Adjust configuration…
Point your domain name to the new host
Point your domain name to the new host
Turn on caching
Turn on caching
Test
Test
Deploying your term project…
Deploying your term project…
Deploying to Dreamhost
Deploying to Dreamhost
Upload your database
Upload your database
Create a database on host
Create a database on host
Export development Drupal database with mysqldump
Export development Drupal database with mysqldump
Import your database into Dreamhost server
Import your database into Dreamhost server
Upload your Web directory
Upload your Web directory
Zip your /var/www directory
Zip your /var/www directory
Copy to dreamhost server
Copy to dreamhost server
Unzip in appropriate directory
Unzip in appropriate directory
Modify settings as needed
Modify settings as needed
settings.php – for logging in to the dreamhost database
settings.php – for logging in to the dreamhost database
.htaccess – for finding your files
.htaccess – for finding your files
Revision Control:
Revision Control:
the problem…
the problem…
Have you ever lost work while writing a term
Have you ever lost work while writing a term
paper?
paper?
How do you collaborate on writing projects?
How do you collaborate on writing projects?
Have you ever made changes to a computer
Have you ever made changes to a computer
program that caused it to stop working?
program that caused it to stop working?
How would you collaborate on a development
How would you collaborate on a development
project like a website?
project like a website?
What if you have two versions of your website and
What if you have two versions of your website and
need to manage merges and synchronization?
need to manage merges and synchronization?
Revision Control
Revision Control
Revision control (or source control or version
Revision control (or source control or version
control) systems help you
control) systems help you
maintain old and new versions of code
maintain old and new versions of code
view and reconcile difference between versions
view and reconcile difference between versions
check out and check in code
check out and check in code
keep track of every change: who, why?
keep track of every change: who, why?
revert to previous versions of your code
revert to previous versions of your code
Revision Control Systems
Revision Control Systems
Popular revision control systems
Popular revision control systems
CVS
CVS
old, stable
old, stable
used by Drupal, sourceforge
used by Drupal, sourceforge
Subversion (SVN)
Subversion (SVN)
newer, quite popular
newer, quite popular
Install on your own PC!
Install on your own PC!
Git
Git
Newer, maybe most popular?
Newer, maybe most popular?
Many others…
Many others…
Drupal and CVS
Drupal and CVS
Check out the latest version of a drupal release:
Check out the latest version of a drupal release:
cvs -
cvs -
d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal
d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal
checkout –r DRUPAL-5 drupal
checkout –r DRUPAL-5 drupal
See what releases are available:
See what releases are available:
cvs -
cvs -
d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal
d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal
status -v CHANGELOG.txt
status -v CHANGELOG.txt
Tags 
Tags 
and 
and 
Branches
Branches
:
:
Each new version of Drupal is a new branch
Each new version of Drupal is a new branch
Tags are snapshots at a point in time of a particular branch
Tags are snapshots at a point in time of a particular branch
Hint: use CVS to get code from drupal.org and use git or
Hint: use CVS to get code from drupal.org and use git or
SVN to do revision control on your own code!
SVN to do revision control on your own code!
Git
Git
Designed for speed
Designed for speed
Originally designed and developed by Linus
Originally designed and developed by Linus
Torvalds for Linux kernel development
Torvalds for Linux kernel development
Distributed (every working directory is a full
Distributed (every working directory is a full
respository)
respository)
Very popular
Very popular
GUI support on various operating systems
GUI support on various operating systems
Git Commands
Git Commands
git-init(1)
git-init(1)
 to create a new repository.
 to create a new repository.
git-show-branch(1)
git-show-branch(1)
 to see where you are.
 to see where you are.
git-log(1)
git-log(1)
 to see what happened.
 to see what happened.
git-checkout(1)
git-checkout(1)
 and 
 and 
git-branch(1)
git-branch(1)
 to switch branches.
 to switch branches.
git-add(1)
git-add(1)
 to manage the index file.
 to manage the index file.
git-diff(1)
git-diff(1)
 and 
 and 
git-status(1)
git-status(1)
 to see what you are in the middle of
 to see what you are in the middle of
doing.
doing.
git-commit(1)
git-commit(1)
 to advance the current branch.
 to advance the current branch.
git-reset(1)
git-reset(1)
 and 
 and 
git-checkout(1)
git-checkout(1)
 (with pathname parameters) to
 (with pathname parameters) to
undo changes.
undo changes.
git-merge(1)
git-merge(1)
 to merge between local branches.
 to merge between local branches.
git-rebase(1)
git-rebase(1)
 to maintain topic branches.
 to maintain topic branches.
git-tag(1)
git-tag(1)
 to mark known point.
 to mark known point.
Sharing your Code
Sharing your Code
When you pass off the website to your client, they
When you pass off the website to your client, they
will also need access to the source code.
will also need access to the source code.
They could download it from the host via FTP or
They could download it from the host via FTP or
scp
scp
You could set up a repository on github.com
You could set up a repository on github.com
This would allow multiple people to work on the site
This would allow multiple people to work on the site
Free for open source projects
Free for open source projects
Dreamhost 
Dreamhost 
has git
has git
use push or clone to upload or
use push or clone to upload or
download your site
download your site
Or host on a site like github.com
Or host on a site like github.com
Slide Note
Embed
Share

Explore the essential steps in web development and deployment including creating development sites, deployment strategies, site maintenance, and revision control. Learn about deploying sites to Dreamhost, handling site maintenance issues, and the importance of revision control systems in collaborative projects. Discover how to save source code, deploy sites efficiently, and manage version control effectively.

  • Web Development
  • Deployment Strategies
  • Site Maintenance
  • Revision Control
  • Dreamhost

Uploaded on Oct 06, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Information Systems 337 Prof. Harry Plantinga Development and Deployment

  2. Developing and Deploying These lab VMs will be going away after the semester ends How will you deploy the site? How will you save the source code so that you or others can work on it later?

  3. Site Maintenance Your web site is up and running, and people are using it You want to change a page You edit the page.tpl.php file. Syntax error! Site goes down! You can't remember how to fix it. Site stays down! You have two people editing the same file. Site down! Work lost! What to do?

  4. Development Strategies You will need live and development sites Devel site on your own VM Deploy site on calvincs.com Live site on client s dreamhost account Ideally: one-button deployment

  5. Deployment Deployment means uploading your site (www directory, databases) to a host Host must support PHP, MySQL, etc. Next lab: deployment on dreamhost (calvincs.com). Other hosts same idea, different details Load your database onto their server Use FTP to load your /var/www/ directory onto their server Adjust configuration Point your domain name to the new host Turn on caching Test Deploying your term project

  6. Deploying to Dreamhost Upload your database Create a database on host Export development Drupal database with mysqldump Import your database into Dreamhost server Upload your Web directory Zip your /var/www directory Copy to dreamhost server Unzip in appropriate directory Modify settings as needed settings.php for logging in to the dreamhost database .htaccess for finding your files

  7. Revision Control: the problem Have you ever lost work while writing a term paper? How do you collaborate on writing projects? Have you ever made changes to a computer program that caused it to stop working? How would you collaborate on a development project like a website? What if you have two versions of your website and need to manage merges and synchronization?

  8. Revision Control Revision control (or source control or version control) systems help you maintain old and new versions of code view and reconcile difference between versions check out and check in code keep track of every change: who, why? revert to previous versions of your code

  9. Revision Control Systems Popular revision control systems CVS old, stable used by Drupal, sourceforge Subversion (SVN) newer, quite popular Install on your own PC! Git Newer, maybe most popular? Many others

  10. Drupal and CVS Check out the latest version of a drupal release: cvs - d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout r DRUPAL-5 drupal See what releases are available: cvs - d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal status -v CHANGELOG.txt Tags and Branches: Each new version of Drupal is a new branch Tags are snapshots at a point in time of a particular branch Hint: use CVS to get code from drupal.org and use git or SVN to do revision control on your own code!

  11. Git Designed for speed Originally designed and developed by Linus Torvalds for Linux kernel development Distributed (every working directory is a full respository) Very popular GUI support on various operating systems

  12. Git Commands git-init(1) to create a new repository. git-show-branch(1) to see where you are. git-log(1) to see what happened. git-checkout(1) and git-branch(1) to switch branches. git-add(1) to manage the index file. git-diff(1) and git-status(1) to see what you are in the middle of doing. git-commit(1) to advance the current branch. git-reset(1) and git-checkout(1) (with pathname parameters) to undo changes. git-merge(1) to merge between local branches. git-rebase(1) to maintain topic branches. git-tag(1) to mark known point.

  13. Sharing your Code When you pass off the website to your client, they will also need access to the source code. They could download it from the host via FTP or scp You could set up a repository on github.com This would allow multiple people to work on the site Free for open source projects Dreamhost has git use push or clone to upload or download your site Or host on a site like github.com

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#