Preface
- Who Is This Book For?
- Why Do You Need This Book?
Introduction
Choosing Your Website Hosting
- Types Of Hosting
- Shared Hosting
- VPS Hosting
- Dedicated Hosting
- Cloud Hosting
- Unmanaged vs Managed Hosting
- Our Recommendation
- Checklist For Choosing Your Optimal Webhost Provider
- Performance Based Considerations
- Benchmarking web hosts
- VPS Virtualization methods considerations
- IPv4 / IPv6 Support
- Example ordering process
- RamNode Ordering
Installing the Operating System
- Choosing a Linux Distribution
- The Linux kernel used should be as recent as possible
- Choosing a Server Distribution
- Installing Ubuntu 19.04
- Selecting the ISO template in the Ramnode Control Panel and Booting from CDROM
- Using Tight VNC Viewer
- Start the Ubuntu Server Install
- Setting up SSH access to login to your server
- Login via SSH
- Updating system packages
- Installing Miscellaneous Tools
- Enabling IPv6 Support
- Useful Linux Commands
- Upgrading Ubuntu 19.04 to a future release
- Remove any unused old kernels
- Do the upgrade via VNC
Performance Baseline
- ServerScope.io
- Testing Ping Speed
Tuning KVM Virtualization Settings
- VPS Control Panel Settings
Tuning Kernel Parameters
- Improving Network speeds (TCP/IP settings)
- Disabling TCP/IP Slow start after idle
- Improving SSD Speeds
- Scheduler Settings
- Reducing writes on your SSD drive
- Other kernel settings
Installing OpenSSL
- Installing OpenSSL 1.1.1c
Securing your Server
- Configuring UFW
- Configuring the ports to open
- A list of ports
- Show the current UFW rules
Ordering a Domain Name For Your Website
- Choosing a Domain Name and a Top Level Domain
- Ordering a Domain With EuroDNS
- Configuring a Name Server
- Ordering the DNSMadeEasy DNS Service
Installing MariaDB 10, a MySQL Database Alternative
- Download & Install MariaDB
- Starting and Stopping MariaDB
- Securing MariaDB
- Upgrade MariaDB To a New Version
- Tuning the MariaDB configuration
- Kernel Parameters
- Storage Engines
- Using MySQLTuner
- Enabling HugePages
- System Variables
- Diagnosing MySQL/MariaDB Startup Failures
Installing nginx Webserver
- Why nginx ?
- Installing nginx
- nginx compilation flags
- PID files; what are they?
- nginx Releases
- Starting and stopping nginx
- nginx Configuration
- nginx configuration files
- Test the Correctness of the nginx Configuration Files
- Optimal Nginx configuration settings
- Error Log File Location
- Configuring the Events Directive
- Configuring the HTTP Directive
- Configuring the Mime Types
- Configuring Your Website Domain in nginx
- Updating nginx
Installing PHP
- Which PHP Version?
- Install PHP 7.3
- What is an OpCode Cache?
- Zend OpCache
- FastCGI Process Manager (FPM)
- Other PHP modules
- Testing the PHP Install
- Tuning php.ini settings
- Set maximum execution time
- Set duration of realpath information cache
- Set maximum size of an uploaded file.
- Set maximum amount of memory a script is allowed to allocate
- Set maximum size of HTTP POST data allowed
- Don’t expose to the world that PHP is installed
- Disable functions for security reasons
- Disable X-PHP-Originating-Script header in mails sent by PHP
- Sets the max nesting depth of HTTP input variables
- Sets the max nesting depth of input variables in HTTP GET, POST (eg. $_GET, $_POST.. in PHP)
- Enable Zend Opcache
Installing PHP-FPM
- Configuring PHP-FPM
- Configuring a PHP-FPM Pool
- How to start PHP-FPM
- nginx FPM Configuration
- Viewing the PHP FPM Status Page
- Viewing statistics from the Zend OpCode cache
Installing PHPMyAdmin
- Installing phpMyAdmin
Installing Jetty
- Download Jetty 9.4.x
- Adding the Jetty port to the UFW Firewall
- Enabling Large Page/HugePage support for Java / Jetty
- Forwarding requests from Nginx to our Jetty server
- Garbage Collection in Java
- Optimising Java connections to the MariaDB database
- Download and install the MariaDB JDBC4 driver
- Download and install HikariCP - a database connection pool
Enabling Log rotation
- fail2ban log rotation
- MariaDB Log rotation
- Log Rotation For nginx
- Log File Management For PHP-FPM
- Log File Management For Jetty9
Using a CDN
- Choosing a CDN
- Analysing performance before and after enabling a CDN
- Configuring a CDN service
- Create a New Zone.
- Using a cdn subdomain like cdn.mywebsite.com
- Tuning the performance of your CDN
HTTPS everywhere
- Do you need a secure website?
- Buying a certificate for your site
- Standard certificate
- Wildcard certificate.
- Public and private key length
- Extended Validation certificates and the green bar in the browsers
- Buying the certificate
- Generate a Certificate Signing request
- Ordering a certificate
- Configuring nginx for SSL
- Getting an A+ grade on SSLLabs.com
- Enabling SSL on a CDN
- Enabling SPDY or HTTP/2 on a CDN
HTTPS certificates via Let’s Encrypt
- Install Certbot / Let’s Encrypt
- Generating a certificate for yourdomain.com
- Configure nginx to use Let’s Encrypt certificate
- Automating renewal of Let’s Encrypt certificates
- Using DNS challenge to generate and validate your certificate
Configure Email For Your Domain
- Selfhosted Email Servers vs External Mail Systems
- Signup for Zoho email
- Verify Domain
- Add Users
- Add Groups
- Configure Email Delivery
- Securing your email address
Installing Wordpress
- Downloading Wordpress
- Enabling PHP In Your Nginx Server Configuration
- Creating a Database For Your Wordpress Installation
- Installing Wordpress
- Enabling auto-updates for Wordpress (core, plugins and themes)
- Installing Wordpress plugins
- Installing Yoast SEO
Optimizing Wordpress performance
- Upload small sized images in the Wordpress media library
- Resizing images with Imagemagick
- EWWW Image Optimizer Wordpress plugin
- Remove CSS Link IDs plugin
- Disable Emojis support in Wordpress 4.2 and later
- Install the Cache Enabler plugin
- Install the CDN Enabler plugin
- Optimizing Wordpress performance with the W3 Total Cache plugin (deprecated)
- Installing W3 Total Cache
Appendix: Resources
- TCP IP
- Ubuntu / Linux
- KVM
- SSD
- OpenSSL
- Nginx
- PHP
- MariaDB
- Jetty
- CDN
- HTTPS