VPS Linux Guides - CentOS

Securing websites running on CentOS with Apache 2.4

LetsEncrypt / Certbot Installation

Install

git clone https://github.com/certbot/certbot
cd certbot
./certbot-auto --help

pip and virtualenv require epel on centos 6

yum install epel-release

To run the webroot commands setup the domain correctly on http and make sure access to .well-known is allowed.
Otherwise you will need to shutdown apache and use the –standalone flag.

Cert for plain html app

sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/ --agree-tos --debug -d www.domain.tld
sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/ --agree-tos --debug -d domain.tld

Cert for simple php app

sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/app/ --agree-tos --debug -d www.domain.tld
sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/app/ --agree-tos --debug -d domain.tld

Cert for rewrite php app e.g frameworks

sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/app/public/ --agree-tos --debug -d www.domain.tld
sudo ./certbot-auto certonly -a webroot --webroot-path /home/username/html/domain.tld/app/public/ --agree-tos --debug -d domain.tld