i would like to make something like creating subdomains on my Apache server.
it can only work, when i create a config file for every subdomains, or i add to httpd-vhosts something like this
CustomLog "logs/dummy-host2.example.com-access_log" common
but what i have to do too, is, change the /etc/hosts file.
add something like, for example: 127.0.0.1 dummy-host2.example.com
the question is, how can i do this from some php script? when the user comes, wants to registrate himself -> by this registration i have to do those things written above, and he will have his subdomain. but, i cannot change /etc/hosts file, because it is owned by root, and php scripts are running under some apache user.
i dont know, if this is possible to make with suid and how is it possible...
pls, how can i do this?
thanks for answers