[ ] Reverse Proxy Apache (Debian 8) Let's Encrypt |
aptitude install -y build-essential
aptitude install -y libapache2-mod-proxy-html libxml2-dev
aptitude install -y apache2
a2enmod proxy
a2enmod proxy_http
a2enmod proxy_ajp
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod proxy_balancer
a2enmod proxy_html
a2enmod proxy_ftp
a2enmod proxy_connect
a2enmod ssl
service apache2 restart
aptitude install apache2-prefork-dev libxml2 libxml2-dev apache2-dev
mkdir ~/modbuild/ && cd ~/modbuild/
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.c
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.h
apxs2 -aic -I/usr/include/libxml2 ./mod_xml2enc.c
cd ~
rm -rfd ~/modbuild/
service apache2 restart
mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
touch /etc/apache2/sites-available/sambi4.conf
ServerName sambi4.ru
Redirect permanent / https://sambi4.ru/ # https
SSLEngine On
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
ProxyVia full
SSLCertificateFile /etc/apache2/ssl/server.crt #
SSLCertificateKeyFile /etc/apache2/ssl/server.key #
ProxyHTMLInterp On
ProxyHTMLExtended On
Order deny,allow
Allow from all
ProxyPass / https://192.168.199.78/ #IP .
ProxyPassReverse / https://192.168.199.78/ #IP .
ServerName sambi4.ru
ServerAdmin sambi4@sambi4.ru # email
DocumentRoot "/var/www/html" # , .
a2ensite /etc/apache2/sites-available/sambi4.conf
service apache2 restart
echo 'deb http://ftp.debian.org/debian jessie-backports main' | tee /etc/apt/sources.list.d/backports.list
aptitude update
aptitude install -y python-certbot-apache -t jessie-backports
certbot --apache
ERROR:letsencrypt_apache.configurator:No vhost exists with servername or alias of: sambi4.ru. No vhost was selected. Please specify servernames in the Apache config
git clone https://github.com/certbot/certbot.git
cd /usr/lib/python2.7/dist-packages
cp /root/certbot/certbot /usr/lib/python2.7/dist-packages/
cp /root/certbot/acme/acme/ /usr/lib/python2.7/dist-packages/
cp /root/certbot/certbot-apache/certbot_apache/ /usr/lib/python2.7/dist-packages/
certbot --apache
30 2 * * 1 /usr/bin/certbot renew >> /var/log/le-renew.log
crontab -e