Chapter 1: Introduction
- Summary of tasks covered
- Tools used
- Low cost
- Website URLs
- 3 types of hosting platform
Chapter 2: Preparation
- CLI and SSH
- Terminal versus iTerm2
- Incremental changes
- Target audience
- cost for domain/VPS
Chapter 3: Buy domain name and VPS
- Get a domain name to play with - namecheap.com
- Check status of the domain name on icann.org
- Verify with ICANN
- Create a SSH key pair
- Digital Ocean
- Add ssh public key to Digital Ocean
- Start up a Digital Ocean droplet.
- Initial ssh into droplet: dserver01
- Danger with SSH and different computers involved
- Create a test file on dserver01
- Rebuild versus destroy a droplet
- Rebuild a droplet
- SSHing into a rebuilt droplet
- Log into rebuilt droplet (dserver01)
- Firewalld on droplet (dserver01)
- Browser choice
- Verify server IP on web page
- Firefox Private Window
- Test install Apache web server
- Status check
- Signing up with CloudFlare
- Transfer name server from namecheap.com to cloudflare.com
- Test browsing devopsdiy.xyz (use your domain)
- Cloudflare.com: change IP for A record of devopsdiy.xyz
- Cloudflare.com: CNAME for www.devopsdiy.xyz
- www versus non-www URL
- Cloudflare.com: add 2 more subdomains
- cloudflare.com and DNS changes
- CloudFlare: “Proxied” vs. “DNS only”
- SSH into dserver01 with hostname
- Status check
Chapter 4: Basic configuration of dserver01
- yum update
- Configure dserver01 server
- Quick primer on bash script
- First bash script
- cat, less
- bash script with functions
- bash script to set up CentOS 7
useraandtestuser1plus ssh public key- Update SSH public key in
setup01-devopsdiy.sh - Self deleting setup01-devopsdiy.sh
- firewalld and setup01-devopsdiy.sh
- SSH into dserver01.
- Check if screen is installed
- Run
setup01-devopsdiy.sh - Test logging in as
userawith sudo privilege - failed login attempts
- Verify
screenis installed - Self-delete of
setup01-devopsdiy.sh - Disable ssh login for
root
Chapter 5: Install Apache
- Update httpd.conf
- Configure Apache for devopsdiy.xyz
- Add 2 more domains for dev and qa work
Chapter 6: Install nginx
- nginx
- screen - virtual session
- tmux
- openssl dhparam
- Prepare Apache to work with nginx
- Free up port 80
- Install nginx
- Configure nginx
- Server blocks in nginx
- devel, qatest and www
- systemctl enable
- Status
Chapter 7: LetsEncrypt
- LetsEncrypt
- Install LetsEncrypt
- .well-known
- Get ssl cert for all 3 domains
- LetsEncrypt renewal test
- Update nginx config files to use SSL
- ssl config for devopsdiy.xyz
- ssl and www to non-www redirect
- Update devel.devopsdiy.xyz.proxy.conf file to use SSL
- Update qatest.devopsdiy.xyz.proxy.conf file to use SSL
- Get A+ instead of B from https://www.ssllabs.com/ssltest/
Chapter 8: Logging
- Logging source IP into Apache log files
- tail -f in multiple iTerm2 panes
- Real IP
- access.log: logs before update
- access.log: logs we want to see after update
- error.log: logs before update
- Updating Apache Global configuration
- nginx Global configuration update
- update Virtual Host configuration
- Testing logging with Proxy turned off and on
- Logrotate
- Install brew and curl
- Generate logs for test
- bin folder
- Saving command output into a file
- Tools to use
- Update logrotate for httpd
- Logrotate for low volume production
- Logrotate for high volume production
Chapter 9: deploy content with rsync/script
- Get HTML5 template website
- Prep on macOS to upload files
- Uploading website content to dserver01
- Check uploaded files on dserver01
- Get deploy-html-runonserver.sh
- Initial run of deploy-html-runonserver.sh
- Deploying to devel, qatest and production
- Deploy to devel site
- Deploy to QAtest site
- Try deploy to Production site without -f y
- Deploy to Production site with -f y
- uptimerobot.com
Chapter 10: Git repository
- Set up Git repo
- Create a new repository
- Add SSH Public key on github
- Git clone the git repo
- Git checkin - initial
- Add one file to git repo
- Deploying content directly from git repo to web server
Chapter 11: Jenkins
- Jenkins and Git
- Setting up Jenkins server on CentOS 7
- VPS for jenkserv01
- Install git
- Install Jenkins
- Install nginx
- Static website by nginx
- Install LetsEncrypt
- openssl dhparam in screen
- .well-known folder for nginx
- Create SSL cert
- Reverse Proxy for Jenkins
- Block port 8080
- Initial log in into Jenkins
- Updating Jenkins
- SSH key pair for user
jenkinson jenkserv01 - Prep dserver01 for Jenkins jobs
- Test sshing in from jenkserv01 to dserver01
- Github and Deploy key (SSH public key)
- Create zero-out-site.sh
- Create monitor-folder-size.sh
- Prep iTerm2 window for use in test
- Create a Jenkins job to use with Git repo
- Add SSH Servers in Jenkins
- Create a Jenkins job to use with rsynced up files
- Available deployment methods
- Jenkins Global Security setup
- Prepare Jenkins job to run with curl
- Verify Jenkins job
devopsdiy.xyz-rsyncfor curl - curl to run a Jenkins job
- Available deployment methods
- Issues with using curl deploy method
- Use deploy-html-jenkins.sh
- Testing deploy-html-jenkins.sh
- Using deploy-html-jenkins.sh
Source code
- add-user-jenkagent.sh
- apache-logrotate-test-tool.sh
- deploy-html-jenkins.sh
- deploy-html-runonserver.sh
- setup01-devopsdiy.sh
- zero-out-site.sh