I can't bring myself to help you make Apache write to files in /etc/sysconfig/network-scripts/
. But there is another option: create a symlink from /etc/sysconfig/network-scripts/ifcfg-eth0
to a file that Apache can write to, for example:
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak
ln -s /var/www/cgi-bin/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
This way, your (ahem, dangerous) CGI script can rewrite the file in /var/www/cgi-bin
, and the system can get the network settings from it.