sudo apt update
sudo a2enmod cgid
sudo service apache2 restart
sudo apt-get -y install apache2-suexec-custom
sudo a2enmod suexec
sudo service apache2 restart
sudo mkdir -p /usr/lib/cgi-bin/gg
sudo chown $(whoami):$(whoami) /usr/lib/cgi-bin/gg
sudo sed -i '1c\/usr/lib/cgi-bin/gg' /etc/apache2/suexec/www-data
sudo mv /var/lib/gg/bld/func-test/func-test /usr/lib/cgi-bin/gg
sudo chown $(whoami):$(whoami) /usr/lib/cgi-bin/gg/func-test
sudo chmod 700 /usr/lib/cgi-bin/gg/func-test
sudo sed -i "/SuexecUserGroup/d" /etc/apache2/sites-enabled/000-default.conf
sudo sed -i "s/<\/VirtualHost>/SuexecUserGroup $(whoami) $(whoami)\n<\/VirtualHost>/g" /etc/apache2/sites-enabled/000-default.conf
sudo service apache2 restart
Copied!