在ubuntu中自动创建apache2虚拟主机
apache2-vh的Python项目详细描述
为Ubuntu开发的Apache2虚拟主机创建程序
##安装
pip install apache2-vh
用法
您可以看到所有命令和基本用法键入:
vh –help
usage: vh server_name folder_name [-h] [-m2] [-a SERVER_ALIAS] [-d DIRECTORY_ROOT] [-p PORT] [-c CONF_NAME]
最少使用两个参数:
server_name Your server name (ex.: blabla.com) folder_name The folder name where your project is in the document root (default is /var/www/html if you have in a different place set it with -dr)
但您还有一些可选参数:
-m2, –magento2 Virtual Host para magento 2 (if you are creating virtual host for magento2) -a SERVER_ALIAS, –server_alias SERVER_ALIAS Add a server alias (ex.: www.blabla.com) -d DIRECTORY_ROOT, –directory_root DIRECTORY_ROOT Full path of your apache document root that will be set in the virtual host (default is /var/www/html) -p PORT, –port PORT Change the listening port (default is 80) -c CONF_NAME, –conf_name CONF_NAME Add a diferent name to your conf file (without the .conf extension) default is the name of your folder_name (ex.: blabla -> file created blabla.conf)
注释
Feel free to use, copy, extend or contribute to this project, if you want to reuse a mention to this project is appreciated, but I don’t really care if you don’t do it. This is a open source project without any warranty or something like that.