Changes

From SME Server
Jump to navigationJump to search
1,145 bytes added ,  21:25, 24 July 2022
Line 64: Line 64:  
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  systemctl restart httpd-e-smith
 
  systemctl restart httpd-e-smith
Remove all access by Country
+
 
 +
you will then need to add sections manually in a template-custom, first for manager related things that should never have access to http (80):
 +
mkdir /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHost -p
 +
printf '{
 +
  $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ?  'yes' : 'no';
 +
  if (($haveSSL eq 'yes') && ($port eq $httpsPort) )
 +
  $OUT ="
 +
    <Location /server-manager>
 +
        Require env AllowCountries
 +
    </Location>
 +
    <Location /user-manager>
 +
        Require env AllowCountries
 +
    </Location>
 +
    <Location /user-password>
 +
        Require env AllowCountries
 +
    </Location>\n";
 +
}' > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHost/98geoipallow
 +
for directory:
 +
printf '
 +
<Directory /home/e-smith/files/ibays/Primary/html>
 +
      Require env AllowCountries
 +
</Directory>
 +
<Directory "/usr/share/nextcloud">
 +
      Require env AllowCountries
 +
</Directory>
 +
' > /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98geoipallow
 +
 
 +
 
 +
then expand
 +
expand-template /etc/httpd/conf/httpd.conf
 +
httpd -t
 +
 
 +
if syntx OK then restart httpd
 +
systemctl restart httpd-e-smith
 +
 
 +
 
 +
To remove all access by Country
 
  config delprop httpd-admin ValidFromGeoIP  
 
  config delprop httpd-admin ValidFromGeoIP  
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,250

edits

Navigation menu