0

i've server without any control panel

and i am trying to build file that allow me to add subdomains to my site

by editing ( apache config file ) and ( named zones )

but i've no permissions to edit this files!! i am only able to read them!

my example file is

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 been read files successfully, but i am unable to edit !!

So, How can i allow the file to edit?

1 Answer 1

3

Seems like a rhetorical question, i've no permissions to edit this files, How can i allow the file to edit?.

What you could try is just leave the config files alone and if you can setup a wild-card sub-domain, use a url rewrite to route the different sub-domains to different locations / folders. The exact how-to would depend on the platform you are on.

Sign up to request clarification or add additional context in comments.

2 Comments

You responded to a question that does not exist, my question is How to give access to the php to be able to edit the apache config file, your answer is more insulting than the benefit, thank you and i am sorry for my language
@Alaa Gamal I did not mean to insult, I just pointed out the contradiction in your question; if you don't have permissions to change a file, you cannot change it so you need an alternative solution, which I provided (although just the basic idea...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.