FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

middleware:httpd:index.html



This is an old revision of the document!


Top#Middleware Management

Apache httpd (httpd.py)

Operation

$ fab -l |grep httpd

$ fab  -H $H auth.pro  httpd.install_yum


httpd.py Fabric Recipes

import sys
from fabric.api import *
from fabric.contrib import files
 
#----------------------------------------------------------------------
# Installing Apache httpd
#----------------------------------------------------------------------
#yum
@task
def install_yum():
    sudo("rpm -q httpd        > /dev/null 2>&1 || yum -y install httpd")


#----------------------------------------------------------------------
# Check Files
#----------------------------------------------------------------------
#RHEL/CentOS
@task
def check_files_etc_httpd_centos():
    '''tree -Dpuga  /etc/httpd'''
    run("tree -Dpuga  /etc/httpd")

#Debian/Ubuntu
@task
def check_files_etc_httpd_ubuntu():
    '''tree -Dpuga  /etc/apache2'''
    run("tree -Dpuga  /etc/apache2")

#----------------------------------------------------------------------
# Check Modules
#----------------------------------------------------------------------
#RHEL/CentOS
@task
def check_modules_pkg():
    '''/usr/sbin/httpd -M  # Package'''
    run("/usr/sbin/httpd -M")

@task
def check_modules_src():
    '''/usr/local/apache2/bin/httpd -M  # SRC'''
    run("/usr/local/apache2/bin/httpd -M")


#----------------------------------------------------------------------
# Check Server-Status
#----------------------------------------------------------------------
@task
def check_server-satus():
    '''curl http://localhost/server-status?auto'''
    run("curl  http://localhost/server-status?auto")


#----------------------------------------------------------------------
# Check Header
#----------------------------------------------------------------------
@task
def check_header():
    '''curl -I http://localhost/'''
    run("curl -I http://localhost/")



Configuration



middleware/httpd/index.html.1513701632.txt.gz ยท Last modified: 2017/12/20 01:40 by kurihara