Sitelet https://github.com/jaredsmyth/python-command-line-new-virtual-host
Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

python-command-line-new-virtual-host

script to create a new virtual host with two arguments for name and directory that you can pass to it from the command line

jared smith | http://jaredsmyth.info

jvst | http://jvst.us

usage

1) follow this tutorial to setup up vhosts on your mac if you are running vhosts for the frst time http://foundationphp.com/tutorials/vhosts_leopard.php

2) place the newhost.py file in your '~/' directoy

3) you can begin using just like that by calling
sudo python ~/newhost.py "name_of_your_vhost" "directory"
-- note that the directory parameter is optional. if left blank it will create an entry using the current working directory as your host --

4) if you want to make your life easier and type less you can add an alias for this in your '~/.bash_profile'
sudo nano ~/.bash_profile
add the following line
alias newhost='sudo python ~/newhost.py'
then restart your terminal for the changes to take effect

5) if you added the alias in you '~/.bash_profile' in the above step you can now use this script to create new vhosts by simply typing
newhost "name_of_your_vhost" "directory"
-- again, note that the directory parameter is optional --


requirements:

  • python
  • apache setup and running for vhosts

About

create new virtual host from simple command line arguments

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors