Skip to main content

Simple CLI tool to create and delete easily virtual hosts in Apache.

Project description

a2svm is a Simple CLI tool to create and delete easily virtualhosts in Apache.

usage: a2svm [-h] [-v] {mk,ls,rm,en,ds} …

a2svm commands are:

  • mk Create a virtualhosts

  • ls Show managed virtualhosts on Apache server

  • rm Delete a virtualhosts

  • en Enable a virtualhosts

  • ds Disable a virtualhosts

See ‘a2svm <command> -h’ for more information on a specific command.

PyPI package http://pypi.python.org/pypi/a2svm

Sources https://github.com/cypx/a2svm

Requirements

a2svm need apache mod_macro which could be installed on debian 6 by the following command

$ aptitude install libapache2-mod-macro

Once mod_macro is avalaible some template could be created for use by a2svm like this one

<Macro vhost_standard $name $servername $directory>
  <VirtualHost *:80>

    ServerName $servername

    DocumentRoot /var/www/$directory/public

    <Directory /var/www/$directory>
        Options  FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error-$name.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access-$name.log combined
  </VirtualHost>
</Macro>

#Comments beginning by "a2svm_make_command" are used to run external commands
#when vhost is created
#a2svm_make_command: /bin/mkdir -p /var/www/$directory/public /var/www/$directory/log
#a2svm_make_command: /bin/chown -R cyp:www-data /var/www/$directory
#Comments beginning by "a2svm_remove_command" are used to run external commands
#when vhost is removed
#a2svm_remove_command: /bin/tar czf /var/www/archive/$servername.tgz /var/www/$directory
#a2svm_remove_command: /bin/rm -rf /var/www/$directory

Installation

Install it easily:

Using pip

$ pip install a2svm

Warning! On some old distribution using Python 2.x, you could require to upgrade pip to support install, run:

$ pip install --index-url=https://pypi.python.org/simple/ --upgrade pip setuptools

Using easy_install

On most Linux distribution

$ easy_install a2svm

But on some, prerequisites are required, for example, on Debian 6

$ aptitude install python-pip

Upgrade

Using pip

$ pip --upgrade a2svm

Using easy_install

$ easy_install --upgrade a2svm

From sources

$ git clone https://github.com/cypx/a2svm
$ cd a2svm
    $ pip install -r requirements.txt
$ python setup.py install

Reminder

To publish package on pypi

$ pip install twine
$ rm -rf dist
$ python setup.py sdist bdist_wheel
$ twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2svm-0.1.5.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

a2svm-0.1.5-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file a2svm-0.1.5.tar.gz.

File metadata

  • Download URL: a2svm-0.1.5.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for a2svm-0.1.5.tar.gz
Algorithm Hash digest
SHA256 58aea968870bbf32a15fd44c0b62935fbe0381feb9b867ae93b3b24df6b5f9f9
MD5 d8963479f35caaba1ef43d2297180e39
BLAKE2b-256 a64155848c279e7fa701a769c1cd546e5ef05e6222f82a2f415e0740fc4f8a89

See more details on using hashes here.

File details

Details for the file a2svm-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: a2svm-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for a2svm-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49cad7b4fc7e2aa2d066346ded91a35a3519e43344da3d6a4b6f9f6089b17b51
MD5 65a3eb6fc63907250a8c7611bab75fed
BLAKE2b-256 461eb5248e1d2a70708a93c875bb823a8350b87f20ea8e1d6a4b69cef8a41d2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page