我正在尝试使用从 PHP 调用的 bash 文件编辑 /etc/httpd/conf.d/ssl.conf exec
:
#comment those lines in ssl.conf
sed -i 's/^SSLCertificateFile/#SSLCertificateFile/g' /etc/httpd/conf.d/ssl.conf
sed -i 's/^SSLCertificateKeyFile/#SSLCertificateKeyFile/g' /etc/httpd/conf.d/ssl.conf
#uncomment those lines in ssl.conf
sed -i 's/^#SSLCertificateFile/SSLCertificateFile/g' /etc/httpd/conf.d/ssl.conf
sed -i 's/^#SSLCertificateKeyFile/SSLCertificateKeyFile/g' /etc/httpd/conf.d/ssl.conf
但我收到此错误:
sed: couldn't open temporary file /etc/httpd/conf.d/sed3nRibG: Permission denied
sed: couldn't open temporary file /etc/httpd/conf.d/sed2ASgeG: Permission denied
我将文件的所有者apache
和权限更改a+xw
为,ssl.conf
但没有帮助。
任何想法 ?