This module supports to handle Apache Virtual Host Editor under ptdeploy. It can function in two ways. They are add and remove. Vhost Editor is a PHP Tool written to make adding virtual hosts to apache a breeze. Vhost Editor will enable the user to add, edit, or delete Virtual Host information on user’s webserver. It is convenient to work with Ubuntu and cent OS. Let’s see how the apache Vhost Editor can function under ptdeploy.
This help command guides the user to create a hosteditor. The help command for Hosteditor is shown below.
ptdeploy Hosteditor help
After inputs the above command, it starts functioning to add a virtual host editor. It catechesis the functions in the screenshots.
kevell@corp:/# ptdeploy HostEditor help
******************************
This command is part of Default Modules and handles Host File Management Functions.
HostEditor, hosteditor, he, hostEditor
- add
add a Host File entry
example: ptdeploy hosteditor add
example: ptdeploy hosteditor add --yes
--host-ip=127.0.0.1 # guess will assume 127.0.0.1
--host-name=dave.com
- rm
remove a Host File entry
example: ptdeploy hosteditor rm
example: ptdeploy hosteditor rm --yes
--host-ip=127.0.0.1 # guess will ignore this, and remove any entry matching the host name
--host-name=dave.com
------------------------------
End Help
******************************
The following are the alternative parameters that can be defined in declarations:
HostEditor, hosteditor, he, hostEditor
This facilitates the user to create a host editor. The user can enter the according to their wish.
sudo ptdeploy hosteditor add
After input as the above command the user can fill the following process.
kevell@corp:/# ptdeploy hosteditor add
Do you want to add a hosts file entry? (Y/N)
y
Do you want a non-default IP? Enter for 127.0.0.1
127.0.0.1
What URI do you want to affect to the hostfile?
karuna
Please check host file: 127.0.0.1 localhost
127.0.1.1 karuna
127.0.1.1 www.kevell.com
127.0.1.1 www.ptbuild.tld
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
--host-ip=127.0.0.1 # guess will assume 127.0.0.1 --host-name=dave.com127.0.0.1 dave.com
127.0.0.1 dave.com
192.168.1.4
127.0.0.1 deepak
clear
127.0.0.1 www.kevell.com
127.0.0.1
127.0.0.1 karuna
Is this Okay? (Y/N)
y
******************************
1Host Editor Finished
******************************
kevell@corp:/# ptdeploy hosteditor add --yes
Do you want a non-default IP? Enter for 127.0.0.1
127.0.0.1
What URI do you want to affect to the hostfile?
kumar
******************************
1Host Editor Finished
******************************
The terminal command for deleting hosteditor is rm. The general format of this command is rm . rm removes a host if you specify a correct path for it and if you don’t, then it displays an error message and move on to the next host.
The following command used to delete the virtual host.
sudo ptdeploy hosteditor rm
The following screen shot can explain its functions.
kevell@corp:/# ptdeploy hosteditor rm
Do you want to remove a hosts file entry? (Y/N)
y
Do you want a non-default IP? Enter for 127.0.0.1
127.0.0.1
What URI do you want to affect to the hostfile?
karuna
Please check host file: 127.0.0.1 localhost
127.0.1.1 karuna
127.0.1.1 www.kevell.com
127.0.1.1 www.ptbuild.tld
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
--host-ip=127.0.0.1 # guess will assume 127.0.0.1 --host-name=dave.com127.0.0.1 dave.com
127.0.0.1 dave.com
192.168.1.4
127.0.0.1 deepak
clear
127.0.0.1 www.kevell.com
127.0.0.1
127.0.0.1 nithin
127.0.0.1 kumar
Is this Okay? (Y/N)
y
******************************
1Host Editor Finished
******************************
kevell@corp:/# ptdeploy hosteditor rm --yes
Do you want a non-default IP? Enter for 127.0.0.1
127.0.0.1
What URI do you want to affect to the hostfile?
nithin
******************************
1Host Editor Finished
******************************