Coder Social home page Coder Social logo

vhosts's Introduction

#vhosts.py

This is a small python application to nicely display informations about Apache virtual hosts.

###Instalation

$ curl -s https://raw.githubusercontent.com/cbanciu/vhosts/master/vhosts.py > vhosts.py
$ python vhosts.py

Or if you prefer running it directly from github

$ curl -s https://raw.githubusercontent.com/cbanciu/vhosts/master/vhosts.py | python -

###Usage

$ python vhosts.py -h
Usage: vhosts.py [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -d DOMAIN, --domain=DOMAIN
                        Display domain virtualhost info

###Example

$ curl -s https://raw.githubusercontent.com/cbanciu/vhosts/master/vhosts.py | python -

SERVERNAME                    DOCUMENTROOT                            ACCESS_LOG                              ERROR_LOG                               CONFIG_FILE
dummy-host.example.com:80     /www/docs/dummy-host.example.com        logs/dummy-host.example.com-access_log  logs/dummy-host.example.com-error_log   /etc/httpd/conf/httpd.conf
host.example.com:80           /www/docs/host.example.com              logs/host.example.com-access_log        logs/host.example.com-error_log         /etc/httpd/conf.d/vhost.conf
www.host.example.com:80       /www/docs/host.example.com              logs/host.example.com-access_log        logs/host.example.com-error_log         /etc/httpd/conf.d/vhost.conf

Requirements

  • python 2.4 or newer

###Bugs/To Do

  • It kinda works with Plesk
  • It doesn't strip out quotes in names
  • Check if Apache is running

vhosts's People

Contributors

cbanciu avatar

Stargazers

Wes Henderson avatar

Watchers

James Cloos avatar  avatar

vhosts's Issues

can't run as unprivileged user

The script should check if you're running as root and exit if not.

Currently the below is displayed if you run as an unprivileged user:

$ ./vhosts.py
Traceback (most recent call last):
  File "./vhosts.py", line 222, in <module>
    main()
  File "./vhosts.py", line 219, in main
    list_all()
  File "./vhosts.py", line 200, in list_all
    vhost_dict = get_vhost_dict()
  File "./vhosts.py", line 147, in get_vhost_dict
    sites = get_vhosts()
  File "./vhosts.py", line 113, in get_vhosts
    apache_conf = apache_files()[1]
  File "./vhosts.py", line 41, in apache_files
    if apache_files[i][0] in ('"', "'") and apache_files[i][0] == apache_files[i][-1]:
IndexError: list index out of range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.