Virtual Host And Certbot in Raspbian 10: Difference between revisions
Jump to navigation
Jump to search
Line 66: | Line 66: | ||
cd /var/chorke/www/;p='api dev ihe';\ | cd /var/chorke/www/;p='api dev ihe';\ | ||
for s in $p;do d='html docs soft';\ | for s in $p;do d='html docs soft';\ | ||
for f in $d;do | for f in $d;do w="$s.chorke.org/$f";\ | ||
mkdir -p "$ | mkdir -p "$w";\ | ||
done; | done; | ||
done | done | ||
Line 77: | Line 77: | ||
cd /var/chorke/www/;p='dev';\ | cd /var/chorke/www/;p='dev';\ | ||
for s in $p;do d='html docs soft';\ | for s in $p;do d='html docs soft';\ | ||
for f in $d;do | for f in $d;do w="$s.chorke.com/$f";\ | ||
mkdir -p "$ | mkdir -p "$w";\ | ||
done; | done; | ||
done | done | ||
Line 88: | Line 88: | ||
cd /var/shahed/www/;p='dev';\ | cd /var/shahed/www/;p='dev';\ | ||
for s in $p;do d='html docs soft';\ | for s in $p;do d='html docs soft';\ | ||
for f in $d;do | for f in $d;do w="$s.shahed.biz/$f";\ | ||
mkdir -p "$ | mkdir -p "$w";\ | ||
done; | done; | ||
done | done |
Revision as of 02:41, 16 November 2019
All Sites# chorke.{org,com}
mkdir -p /etc/chorke/httpd/conf.sites.all.d
cd /etc/chorke/httpd/conf.sites.all.d
nano 00-dev.chorke.org.conf
nano 00-dev.chorke.org-le-ssl.conf
nano 01-api.chorke.org.conf
nano 01-api.chorke.org-le-ssl.conf
nano 01-ihe.chorke.org.conf
nano 01-ihe.chorke.org-le-ssl.conf
nano 02-dev.chorke.com.conf
nano 02-dev.chorke.com-le-ssl.conf
# shahed.{biz}
mkdir -p /etc/shahed/httpd/conf.sites.all.d
cd /etc/shahed/httpd/conf.sites.all.d
nano 00-dev.shahed.biz.conf
nano 00-dev.shahed.biz-le-ssl.conf
|
Enabled Sites# chorke.{org,com}
mkdir -p /etc/chorke/httpd/conf.sites.enable.d
cd /etc/chorke/httpd/conf.sites.enable.d
ln -s ../conf.sites.all.d/00-dev.chorke.org.conf 00-dev.chorke.org.conf
ln -s ../conf.sites.all.d/00-dev.chorke.org-le-ssl.conf 00-dev.chorke.org-le-ssl.conf
ln -s ../conf.sites.all.d/01-api.chorke.org.conf 01-api.chorke.org.conf
ln -s ../conf.sites.all.d/01-api.chorke.org-le-ssl.conf 01-api.chorke.org-le-ssl.conf
ln -s ../conf.sites.all.d/01-ihe.chorke.org.conf 01-ihe.chorke.org.conf
ln -s ../conf.sites.all.d/01-ihe.chorke.org-le-ssl.conf 01-ihe.chorke.org-le-ssl.conf
ln -s ../conf.sites.all.d/02-dev.chorke.com.conf 02-dev.chorke.com.conf
ln -s ../conf.sites.all.d/02-dev.chorke.com-le-ssl.conf 02-dev.chorke.com-le-ssl.conf
# shahed.{biz}
mkdir -p /etc/shahed/httpd/conf.sites.enable.d
cd /etc/shahed/httpd/conf.sites.enable.d
ln -s ../conf.sites.all.d/00-dev.shahed.biz.conf 00-dev.shahed.biz.conf
ln -s ../conf.sites.all.d/00-dev.shahed.biz-le-ssl.conf 00-dev.shahed.biz-le-ssl.conf
|
Directory Tree
mkdir -p /var/chorke/www;\
cd /var/chorke/www/;p='api dev ihe';\
for s in $p;do d='html docs soft';\
for f in $d;do w="$s.chorke.org/$f";\
mkdir -p "$w";\
done;
done
|
mkdir -p /var/chorke/www;\
cd /var/chorke/www/;p='dev';\
for s in $p;do d='html docs soft';\
for f in $d;do w="$s.chorke.com/$f";\
mkdir -p "$w";\
done;
done
|
mkdir -p /var/shahed/www;\
cd /var/shahed/www/;p='dev';\
for s in $p;do d='html docs soft';\
for f in $d;do w="$s.shahed.biz/$f";\
mkdir -p "$w";\
done;
done
|
;nano /var/chorke/www/api.chorke.org/html/.htaccess
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{SERVER_NAME} =api.chorke.org [OR]
RewriteCond %{SERVER_NAME} =www.api.chorke.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
f='html docs soft';\
for s in *.chorke.*;do for d in $f;do \
h="<html>\n<head><title>$s/$d</title></head>\n";
h="$h<body><h1>Welcome to, $s/$d</h1></body>\n</html>";
echo -e "$h" >> "$s/$d/index.html";
done;done
|
f='html docs soft';\
for s in *.shahed.biz;do for d in $f;do \
h="<html>\n<head><title>$s/$d</title></head>\n";
h="$h<body><h1>Welcome to, $s/$d</h1></body>\n</html>";
echo -e "$h" >> "$s/$d/index.html";
done;done
apt -y install apache2 mod_ssl; a2enmod ssl
cd /opt/;git clone https://github.com/certbot/certbot.git
cd /usr/local/bin/;ln -s /opt/certbot/certbot-auto certbot
ln -s /opt/certbot/letsencrypt-auto letsencrypt
letsencrypt #letsencrypt renew
certbot #certbot renew
|