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
    

      

  • 相关阅读:
    appfuse的一些资源
    实战: SOLR的分布式部署(复制)CollectionDistribute 快照分发 (精简版)
    在SOLR环境变量的配置 过程中,遇到的 A pseudo attribute name is expected 异常
    Solr应用开发——Solr home目录结构简介1
    升级 Solr 1.4 后性能有所提升
    Solr 删除数据的几种方式
    如何使SOLR系统自动AUTO COMMIT
    Solr应用开发——Solr home目录结构简介2
    升级到 solr 1.4 的注意事项
    SOLR环境变量的配置
  • 原文地址:https://www.cnblogs.com/feral/p/6546744.html
Copyright © 2011-2022 走看看