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
<VirtualHost *:80>
ServerAdmin
webmaster@dummy-host2.example.com
DocumentRoot "/www/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
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
Recent comments
1 day 6 hours ago
1 day 6 hours ago
1 day 11 hours ago
1 day 17 hours ago
1 day 18 hours ago
1 day 19 hours ago
2 days 10 min ago
2 days 6 hours ago
2 days 10 hours ago
2 days 12 hours ago