zoukankan      html  css  js  c++  java
  • lamp 脚本

    第一个脚本,用作学习规范和学习命(centos6.x):

    #!/bin/bash
    #-----------------------------------
    #description:	install lamp
    #
    #version:	1.0
    #
    #author:	zhuyu
    #
    #-----------------------------------
    
    #prepare
    
    core=`cat /proc/cpuinfo |grep "processor" |wc -l`
    
    yum -y install httpd mysql-server mysql php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath mhash libmcrypt
    
    #-----------------------------------
    #configure httpd
    
    /bin/sed -i 's/ServerTokens OS/ServerTokens Prod/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/ServerSignature On/ServerSignature Off/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/Options Indexes FollowSymLinks/Options Includes ExecCGI FollowSymLinks/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/AddHandler cgi-script .cgi/AddHandler cgi-script .cgi .pl/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/AllowOverride None/AllowOverride All/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/Options Indexes MultiViews FollowSymLinks/Options MultiViews FollowSymLinks/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/DirectoryIndex index.html index.html.var/DirectoryIndex index.html index.html.var index.php/g' /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/KeepAlive Off/KeepAlive On/g'  /etc/httpd/conf/httpd.conf
    
    /bin/sed -i 's/MaxKeepAliveRequests 100/MaxKeepAliveRequests 1000/g' /etc/httpd/conf/httpd.conf
    
    
    
    #configure mysqld
    
    /bin/cp -f /usr/share/mysql/my-huge.cnf /etc/my.cnf 
    
    sed -i "s/thread_concurrency = 8/thread_concurrency = `expr 2 * $core`/g" /etc/my.cnf
    
    service mysqld restart 
    
    mysqladmin -u root password 'qwe123'
    
    #configure php
    
    sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php.ini
    
    sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php.ini
    
    sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php.ini
    
    sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php.ini
    
    sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini
    
    sed -i 's/disable_functions =.*/disable_functions =passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g' /etc/php.ini
    
    rm -rf /etc/httpd/conf.d/welcome.conf
    rm -rf /var/www/error/noindex.html
    
    echo -e "<?php
    phpinfo();
    ?>" >> /var/www/html/index.php
    
    chkconfig httpd on
    chkconfig mysqld on
    service httpd restart
    service mysqld restart
    

      

  • 相关阅读:
    Java实现 蓝桥杯VIP 算法训练 装箱问题
    Java实现 蓝桥杯VIP 算法训练 入学考试
    Qt4.6.2已编译二进制版本在VS2005中的问题
    函数可重入问题reentrant functions(函数执行过程中可以被中断,允许多个副本)
    QT的Paint 系统
    取clientdataset detal中的 更新数据, 将detal 转 数据库脚本sql
    delphi 八字排盘源码(post数据以后,又分析数据)
    Working with Entity Relations in OData
    图片轮播插件Nivo Slider
    跨域访问 REST API
  • 原文地址:https://www.cnblogs.com/feral/p/6546744.html
Copyright © 2011-2022 走看看