We had a few older Ensim servers that had a mix of sites running 3.1 and High Security Mode. We needed to move all sites to High Security Mode for obvious reasons.
Here is how we did it on a Ensim 4.03 server. There may be better ways and input is appreciated. Also note some code was pulled from other places in this forum and our thanks goes out to those who contributed on other issues.
As the root user create a file in an area that you want to work in. I use /home/admin/
pico high_sec_mode_script and the enter the following:
CODE
#!/bin/sh
for Domain in `/usr/local/bin/sitelookup -a | cut -d, -f1`
do
echo "Setting High Security on $Domain"
/usr/local/bin/EditVirtDomain -D $Domain -c apache,jail=1
done
echo 'Done!'
for Domain in `/usr/local/bin/sitelookup -a | cut -d, -f1`
do
echo "Setting High Security on $Domain"
/usr/local/bin/EditVirtDomain -D $Domain -c apache,jail=1
done
echo 'Done!'
ctrl + x to save
chmod high_sec_mode_script 755
./high_sec_mode_script
The script should now run and will set every domain to High Security Mode. If the domain is already in High Security Mode it will set again anyway. This wont hurt anything. If not it will be moved up to high security and you may notice it takes a bit longer for these domains.
I did see a few domains threw an error. These were do to disk quotas or other minor issues with those sites. They were left in an inconsistenat state (whate ever that means). Those domains I re-opened in the GUI and then re-saved and all was well. This was run on 2 productions servers and tested first on a 3rd server with no problems.
I suggest you remove the file from your server when done.
rm high_sec_mode_script
Good luck.