Welcome, Guest
Please Login or Register.
Lost Password?
server entry in the /etc/hosts (1 viewing)
Post Reply

TOPIC: server entry in the /etc/hosts

#13600
zafar466 (User)
Posts: 1
graphgraph
server entry in the /etc/hosts 2008/06/10 01:57  
Hello,

i am searching the way to handle virutalmin/webmin such that whenever i create a virtual server an entry is made in the /etc/hosts file and when the server is deleted the entry in the /etc/hosts file is deleted

i have been trying to change some code in the create-domain.pl scripts that are executed when a virtual server is created .
but i have not been able to do that
please give some help in this regard

Thanks.
  The administrator has disabled public write access.
#13626
Joe (Admin)
Posts: 3796
graph
Re:server entry in the /etc/hosts 2008/06/10 13:42  
You don't need to modify Virtualmin code (and shouldn't, because it'll just get overwritten every time you upgrade). Virtualmin can execute scripts for you on creation and modification of virtual servers.

Look in Module Configuration in the "Actions upon server and user creation". You can write a script to update hosts, and use the VIRTUALSERVER_DOM to know the hostname and VIRTUALSERVER_IP to know the IP in your script. Other variables are available, see the help for those options. (The options are "Command to run before making changes to a server" and "Command to run after making changes to a server"...there are matching options for aliases, as well.)
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.