FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


middleware:httpd:index.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
middleware:httpd:index.html [2017/12/17 23:46]
kurihara
middleware:httpd:index.html [2018/03/25 00:26]
kurihara
Line 1: Line 1:
 +[[:index.html#Middleware Management|Top#Middleware Management]]
 +
 ====== Apache httpd (httpd.py) ====== ====== Apache httpd (httpd.py) ======
  
-\\+$FHHOME/fabfile/httpd.py 
 {{INLINETOC}} {{INLINETOC}}
 \\ \\
  
  
-===== Operation =====+===== Apache httpd Operation =====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-echo a |fab -l |grep httpd+$ fab -l |grep httpd 
 +</sxh>
  
-echo xx.xx.xx.xx | fab  pro  httpd.install_yum+<sxh bash toolbar:false gutter:false> 
 +$ fab  -H $H auth.pro  httpd.install_yum
 </sxh> </sxh>
 +
 +\\
 +==== Fabric Temporary Run Call Examples ====
 +<sxh bash toolbar:false gutter:false>
 +$ H=test-server-1,test-server-2
 +
 +$ fab  -H $H auth.pro  -- "ps aux |grep apahce"
 +
 +$ fab  -H $H auth.pro  -- tree -Dpuga  /etc/httpd
 +$ fab  -H $H auth.pro  -- tree -Dpuga  /etc/apache2
 +</sxh>
 +
 +
  
  
 \\ \\
-===== httpd.py Fabric Recipes =====+===== httpd.py ===== 
 + 
 +$FHHOME/fabfile/httpd.py 
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 import sys import sys
Line 24: Line 45:
 # Installing Apache httpd # Installing Apache httpd
 #---------------------------------------------------------------------- #----------------------------------------------------------------------
-#yum+httpd.install_yum
 @task @task
 def install_yum(): def install_yum():
     sudo("rpm -q httpd        > /dev/null 2>&1 || yum -y install httpd")     sudo("rpm -q httpd        > /dev/null 2>&1 || yum -y install httpd")
 +
 +# httpd.install_apt
 +@task
 +def install_apt():
 +    sudo("dpkg -l |grep apache    > /dev/null 2>&1 || apt install apahce2")
 +
  
  
Line 34: Line 61:
 #---------------------------------------------------------------------- #----------------------------------------------------------------------
 #RHEL/CentOS #RHEL/CentOS
 +# httpd.check_files_etc_httpd
 @task @task
 def check_files_etc_httpd(): def check_files_etc_httpd():
-    '''tree -Dpuga  /etc/httpd'''+    '''tree -Dpuga  /etc/httpd #centos'''
     run("tree -Dpuga  /etc/httpd")     run("tree -Dpuga  /etc/httpd")
  
 #Debian/Ubuntu #Debian/Ubuntu
 +# httpd.check_files_etc_apache2
 @task @task
-def check_files_etc_httpd(): +def check_files_etc_apache2(): 
-    '''tree -Dpuga  /etc/apache2'''+    '''tree -Dpuga  /etc/apache2  #ubuntu'''
     run("tree -Dpuga  /etc/apache2")     run("tree -Dpuga  /etc/apache2")
  
 +#----------------------------------------------------------------------
 +# Check Configuration
 +#----------------------------------------------------------------------
 +#RHEL/CentOS
 +@task
 +def check_configuration_pkg():
 +    '''apachectl configtest'''
 +    run("apachectl configtest")
 +
 +
 +#----------------------------------------------------------------------
 +# 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")
  
  
Line 60: Line 121:
  
 \\ \\
-===== Configuration ===== +===== Apache httpd Configuration Examples===== 
-  *[[middleware:httpd:httpd.conf_2.4.html]]+  *[[middleware:httpd:conf001.html]] 
 +  *[[middleware:httpd:conf002.html]]
  
 +  *[[middleware:httpd:centos_httpd2.4.html]]
 +  *[[middleware:httpd:ubuntu_httpd2.4.html]]
  
 +\\
 +\\
 +<WRAP box 90%>
 +<catlist .: -noAddPageButton -smallHead -sortAscending>
 +</WRAP>
 +\\
 +[[:index.html#Middleware Management|Top#Middleware Management]]


middleware/httpd/index.html.txt · Last modified: 2019/02/11 00:45 by kurihara