Code Monkey home page Code Monkey logo

dwp's Introduction

DWP

Deployment of Web Projects

Creating Basic Server

Setting Up Server

Login as root

ssh root@[ipAddress]

Add user

adduser [userName]
adduser [userName] sudo

Logout of root and login with new user

exit
ssh [userName]@[ipAddress]

Update and Upgrade Package System

sudo apt-get update
sudo apt-get upgrade

Update package system after upgrade

sudo apt-get update

Install Apache2

sudo apt-get install apache2

Update package system

sudo apt-get update

Install Git

sudo apt-get install git-core

Update package system

sudo apt-get update

Add git username and email

git config --global user.name "username"
git config --global user.email [email protected]

Change permissions to /var/www directory

sudo chown [userName] /var/www

Create another server for production

Creating Git Hook

Switch to beginning of file system

cd /

Create directory for repos

sudo mkdir /var/repos

Change permissions to /var/repos directory

sudo chown [userName] /var/repos

Switch to repos directory and make a new directory for the page created

cd /var/repos
mkdir [pageName].git

Instantiate git

git init --bare

Switch to hooks directory; separate working tree and git directory locations

cd [pageName].git/hooks
nano post-receive

Write in editor

#!/bin/sh
GIT_WORK_TREE=/var/www git checkout -f

Save file

Change permissions to post-receive

chmod +x post-receive

Pushing to Server

Go to your local git directory (where all files for page are)

Make sure you are in master branch

git checkout master

Add Stage Server remote

git remote add [stageServerName] ssh://[userName]@[ipAddress]/var/repos/[pageName].git

Add Production Server remote

git remote add [productionServerName] ssh://[userName]@[ipAddress]/var/repos/[pageName].git

Check status of files ready to be committed

git status

Add all files to be committed later

git add -A

Commit all files

git commit -m '[Enter message of changes made]'

Push to stage server

git push [stageServerName] master

Make sure everything is working fine in stage server, test everything, once everything has been tested push to production server

git push [productionServerName] master

Push all changes to github

git push

dwp's People

Contributors

jjairo92 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.