Virtual Host And Certbot in Raspbian 10: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 56: | Line 56: | ||
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.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 | ln -s ../conf.sites.all.d/00-dev.shahed.biz-le-ssl.conf 00-dev.shahed.biz-le-ssl.conf | ||
</source> | |||
|} | |||
===Directory Tree=== | |||
{| | |||
| valign="top" | | |||
<source lang="bash"> | |||
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 mkdir -p "$s.chorke.org/$f";\ | |||
done; | |||
done | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
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 mkdir -p "$s.chorke.com/$f";\ | |||
done; | |||
done | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
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 mkdir -p "$s.shahed.biz/$f";\ | |||
done; | |||
done | |||
</source> | |||
|} | |||
{| | |||
| valign="top" | | |||
<source lang="ini"> | |||
;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] | |||
</source> | |||
<source lang="ini"> | |||
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 | |||
</source> | |||
| valign="top" | | |||
<source lang="ini"> | |||
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 | |||
</source> | |||
<source lang="bash"> | |||
yum -y install httpd mod_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 | |||
</source> | </source> | ||
|} | |} |
Revision as of 02:07, 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 mkdir -p "$s.chorke.org/$f";\
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 mkdir -p "$s.chorke.com/$f";\
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 mkdir -p "$s.shahed.biz/$f";\
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
yum -y install httpd mod_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
|