[英]How to edit apache config by php file
我的服务器没有任何控制面板
并且我正在尝试构建允许我向我的网站添加子域的文件
通过编辑(apache配置文件)和(命名区域)
但我无权编辑此文件! 我只能阅读它们!
我的示例文件是
mysite.com/panel/file.php
<?
if ( $_GET['read_httpd']){
$content = file_get_contents ( '/etc/httpd/conf/httpd.conf' );
if ( !empty ( $content ) )
echo 'File Read!<br />';
echo $content;
}
elseif ( $_GET['remove_named'] ){
$delete = unlink ( '/var/named/alaa.hosts' );
}
elseif ( $_GET['remove_config'] ){
$delete = unlink ( '/etc/httpd/conf/httpd.conf' );
}
?>
我已经成功读取文件,但是我无法编辑!
那么,如何允许文件进行编辑?
似乎是一个反问, i've no permissions to edit this files, How can i allow the file to edit?
, i've no permissions to edit this files, How can i allow the file to edit?
。
您可以尝试的只是保留配置文件,如果可以设置通配符子域,请使用url重写将不同的子域路由到不同的位置/文件夹。 确切的使用方法取决于您所使用的平台。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.