IPv6-Skizze.

This commit is contained in:
Michael Hierweck 2019-03-05 21:16:00 +01:00
parent d63f4d47dd
commit 3c17c68b4d
7 changed files with 71 additions and 57 deletions

View File

@ -1,9 +1,9 @@
# #
# This file is managed by HSAdmin. # This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80> <VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80 ${pac.curINet6Addr.inetAddr}:80 ${pac.oldINet6Addr.inetAddr}:80>
ServerName ${dom.name} ServerName ${dom.name}
ServerAlias ${dom.serveraliases} ServerAlias ${dom.serveraliases}
ServerAdmin webmaster@${dom.name} ServerAdmin webmaster@${dom.name}
@ -59,8 +59,8 @@
#end #end
RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary] RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# -d RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# -d
RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last] RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last]
#if( !${htdocsfallback} ) #if( !${htdocsfallback} )
RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
@ -70,19 +70,19 @@
RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:80)?$ [novary] RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:80)?$ [novary]
RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
RewriteRule ^(.*) - [redirect=404,last] RewriteRule ^(.*) - [redirect=404,last]
#end #end
AddType application/x-httpd-php .php .php5 .php4 .php3 AddType application/x-httpd-php .php .php5 .php4 .php3
Action application/x-httpd-php /fastcgi-bin/phpstub Action application/x-httpd-php /fastcgi-bin/phpstub
</VirtualHost> </VirtualHost>
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443> <VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443 ${pac.curINet6Addr.inetAddr}:443 ${pac.oldINet6Addr.inetAddr}:443>
ServerName ${dom.name} ServerName ${dom.name}
ServerAlias ${dom.serveraliases} ServerAlias ${dom.serveraliases}
ServerAdmin webmaster@${dom.name} ServerAdmin webmaster@${dom.name}
SuexecUserGroup ${dom.user.name} ${pac.name} SuexecUserGroup ${dom.user.name} ${pac.name}
PassengerEnabled Off PassengerEnabled Off
PassengerUser ${dom.user.name} PassengerUser ${dom.user.name}
PassengerGroup ${pac.name} PassengerGroup ${pac.name}
@ -92,7 +92,7 @@
SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt
SSLCertificateKeyFile /etc/apache2/pems-enabled/${dom.name}.key SSLCertificateKeyFile /etc/apache2/pems-enabled/${dom.name}.key
SSLCertificateChainFile /etc/apache2/pems-enabled/${dom.name}.chain SSLCertificateChainFile /etc/apache2/pems-enabled/${dom.name}.chain
DocumentRoot /home/doms/${dom.name}/htdocs-ssl DocumentRoot /home/doms/${dom.name}/htdocs-ssl
Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/ Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/
@ -123,23 +123,23 @@
SetHandler fcgid-script SetHandler fcgid-script
Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch Options +ExecCGI +IncludesNoExec -Indexes -MultiViews +SymLinksIfOwnerMatch
</Location> </Location>
#if( ${php5} ) #if( ${php5} )
FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php5.6 FcgidInitialEnv HTTP_PHP_BIN /usr/lib/cgi-bin/php5.6
#end #end
RewriteEngine On RewriteEngine On
RewriteOptions Inherit RewriteOptions Inherit
RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
#if( ${letsencrypt} ) #if( ${letsencrypt} )
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end #end
RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary] RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# -d RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# -d
RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last] RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last]
#if( !${htdocsfallback} ) #if( !${htdocsfallback} )
RewriteCond %{REQUEST_URI} !^/cgi-bin/ RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/ RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
@ -149,7 +149,7 @@
RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary] RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary]
RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# !-d RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# !-d
RewriteRule ^(.*) - [redirect=404,last] RewriteRule ^(.*) - [redirect=404,last]
#end #end
AddType application/x-httpd-php .php .php5 .php4 .php3 AddType application/x-httpd-php .php .php5 .php4 .php3
Action application/x-httpd-php /fastcgi-bin/phpstub Action application/x-httpd-php /fastcgi-bin/phpstub

View File

@ -1,24 +1,26 @@
$TTL 6H $TTL 6H
${dom.name}. IN SOA ${dom.dnsMaster}.hostsharing.net. hostmaster.hostsharing.net. ( ${dom.name}. IN SOA ${dom.dnsMaster}.hostsharing.net. hostmaster.hostsharing.net. (
${sio} ; serial secs since Jan 1 1970 ${sio} ; serial secs since Jan 1 1970
6H ; refresh (>=10000) 6H ; refresh (>=10000)
1H ; retry (>=1800) 1H ; retry (>=1800)
1W ; expire 1W ; expire
1H ; minimum 1H ; minimum
) )
${dom.name}. IN NS dns1.hostsharing.net. ${dom.name}. IN NS dns1.hostsharing.net.
${dom.name}. IN NS dns2.hostsharing.net. ${dom.name}. IN NS dns2.hostsharing.net.
${dom.name}. IN NS dns3.hostsharing.net. ${dom.name}. IN NS dns3.hostsharing.net.
${dom.name}. IN MX 30 mailin1.hostsharing.net. ${dom.name}. IN MX 30 mailin1.hostsharing.net.
${dom.name}. IN MX 30 mailin2.hostsharing.net. ${dom.name}. IN MX 30 mailin2.hostsharing.net.
${dom.name}. IN MX 30 mailin3.hostsharing.net. ${dom.name}. IN MX 30 mailin3.hostsharing.net.
${dom.name}. IN A ${pac.curINetAddr.inetAddr} ${dom.name}. IN A ${pac.curINetAddr.inetAddr}
;${dom.name}. IN AAAA ${pac.curINet6Addr.inetAddr}
*.${dom.name}. IN MX 30 mailin1.hostsharing.net. *.${dom.name}. IN MX 30 mailin1.hostsharing.net.
*.${dom.name}. IN MX 30 mailin2.hostsharing.net. *.${dom.name}. IN MX 30 mailin2.hostsharing.net.
*.${dom.name}. IN MX 30 mailin3.hostsharing.net. *.${dom.name}. IN MX 30 mailin3.hostsharing.net.
*.${dom.name}. IN A ${pac.curINetAddr.inetAddr} *.${dom.name}. IN A ${pac.curINetAddr.inetAddr}
;*.${dom.name}. IN AAAA ${pac.curINet6Addr.inetAddr}

View File

@ -176,21 +176,29 @@ public class PacProcessorFactory implements EntityProcessorFactory {
} }
private Processor createIfUp(final Pac pac) { private Processor createIfUp(final Pac pac) {
// return new ShellProcessor("ifup eth0:" + pacName); return new CompoundProcessor(new ShellProcessor("ip addr add "
return new ShellProcessor("ip addr add "
+ pac.getCurINetAddr().getInetAddr() + pac.getCurINetAddr().getInetAddr()
+ "/32 dev eth0 label eth0:" + "/32 dev eth0"
+ pac.getName() + pac.getName()
); ),
new ShellProcessor("ip addr add "
+ pac.getCurINet6Addr().getInetAddr()
+ "/128 dev eth0 noprefixroute preferred_lft 0"
+ pac.getName()
));
} }
private Processor createIfDown(final Pac pac) { private Processor createIfDown(final Pac pac) {
// return new ShellProcessor("ifdown eth0:" + pacName); return new CompoundProcessor(new ShellProcessor("ip addr del "
return new ShellProcessor("ip addr del "
+ pac.getCurINetAddr().getInetAddr() + pac.getCurINetAddr().getInetAddr()
+ "/32 dev eth0 label eth0:" + "/32 dev eth0"
+ pac.getName() + pac.getName()
); ),
new ShellProcessor("ip addr add "
+ pac.getCurINet6Addr().getInetAddr()
+ "/128 dev eth0 noprefixroute preferred_lft 0"
+ pac.getName()
));
} }
private UnixUser getPacAdminUser(Pac pac) throws ProcessorException { private UnixUser getPacAdminUser(Pac pac) throws ProcessorException {

View File

@ -3,17 +3,18 @@
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
127.0.0.1 localhost 127.0.0.1 localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
::1 ip6-localhost ip6-loopback ${hive.inetAddr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
fe00::0 ip6-localnet ${hive.inet6Addr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
${hive.inetAddr.inetAddr} ${hive.name}.hostsharing.net ${hive.name} localhive
#foreach( $pac in ${hive.webpacs} ) #foreach( $pac in ${hive.webpacs} )
${pac.curINetAddr.inetAddr} ${pac.name}.hostsharing.net ${pac.name} ${pac.curINetAddr.inetAddr} ${pac.name}.hostsharing.net ${pac.name}
${pac.curINet6Addr.inetAddr} ${pac.name}.hostsharing.net ${pac.name}
#end #end

View File

@ -4,7 +4,7 @@
# #
#foreach( $pac in ${hive.webpacs} ) #foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}:80> <VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.curINet6Addr.inetAddr}:80>
ServerName _ ServerName _
ServerAdmin webmaster@${pac.name}.hostsharing.net ServerAdmin webmaster@${pac.name}.hostsharing.net
@ -15,7 +15,7 @@
</VirtualHost> </VirtualHost>
<VirtualHost ${pac.curINetAddr.inetAddr}:443> <VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.curINet6Addr.inetAddr}:443>
ServerName _ ServerName _
ServerAdmin webmaster@${pac.name}.hostsharing.net ServerAdmin webmaster@${pac.name}.hostsharing.net

View File

@ -0,0 +1,8 @@
#
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
#
#foreach( $pac in ${hive.webpacs} )
eth0:${pac.name}:${pac.curINet6Addr.inetAddr}/128
#end

View File

@ -1,21 +1,19 @@
# #
# This file is managed by HSAdmin. # This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten. # Do not edit manually. Changes will be overwritten.
# #
#foreach( $pac in ${hive.webpacs} ) #foreach( $pac in ${hive.webpacs} )
<VirtualHost ${pac.curINetAddr.inetAddr}> <VirtualHost ${pac.curINetAddr.inetAddr} ${pac.curINet6Addr.inetAddr}>
DefaultRoot ~ ${pac.name} DefaultRoot ~ ${pac.name}
ServerName "${pac.name}.hostsharing.net" ServerName "${pac.name}.hostsharing.net"
AllowOverwrite on AllowOverwrite on
AllowForeignAddress on AllowForeignAddress on
<Limit LOGIN> <Limit LOGIN>
Order allow,deny Order allow,deny
AllowGroup ${pac.name} AllowGroup ${pac.name}
DenyAll DenyAll
</Limit> </Limit>
<Anonymous /home/pacs/${pac.name}/ftp> <Anonymous /home/pacs/${pac.name}/ftp>
User ${pac.name} User ${pac.name}
Group ${pac.name} Group ${pac.name}
@ -25,13 +23,10 @@
DirFakeGroup on ftp DirFakeGroup on ftp
DirFakeMode 000 DirFakeMode 000
AuthAliasOnly on AuthAliasOnly on
<Limit WRITE> <Limit WRITE>
DenyAll DenyAll
</Limit> </Limit>
</Anonymous> </Anonymous>
</VirtualHost> </VirtualHost>
#end #end