• Ubuntu 脚本笔记


    1.Update Ubuntu
    :apt-get update
    :apt-get upgrade
    :apt-get dist-upgrade
    
    2.Create swap on aliyun ubuntu(512MB ram *2=1024MB swap)
    :mkdir swap
    :cd swap
    :dd if=/dev/zero of=swapfile bs=1M count=1024
    :mkswap swapfile
    :swapon swapfile
    :free -m
    
    3.Install MC
    :apt-get install mc
    
    4.Install Apache2 and config mods
    :apt-get install apache2
    :a2enmod dis-cache
    
    5.Create virtal host in apache2
    :cp /etc/apache2/sites-available/default /etc/apache2/sites-available/jinzhao.me
    :nano /etc/apache2/sites-available/jinzhao.me
    //change the default path to /var/www/jinzhao.me
    :mkdir /var/www/jinzhao.me
    :echo "<h1>Oh yeah~</h1>" | sudo tee /var/www/jinzhao.me/index.html
    :a2dissite default && sudo a2ensite jinzhao.me
    :service apache2 restart
    
    6.Apache service stress test
    :ab -n 20000 -c 200 http://localhost/
    
    7.Hid Apache head info
    :nano /etc/apache2/apache2.conf
    //append two line below
    //ServerTokens Prod
    //ServerSignature Off
    
    8.Check apache running user
    :ps auxf | grep apache
    
    9.Install php and mysql
    :apt-get install apache2 libapache2-mod-php5 php5-mysql mysql-server mysql-client
    :apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap 
    
    php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite 
    
    php5-tidy php5-xmlrpc php5-xsl
    //:php5-mcrypt php5-memcache
    
    10.Install phpmyadmin
    :apt-get install phpmyadmin
    :cp -r /usr/share/phpmyadmin /var/www/phpmyadmin
    :cp /etc/apache2/sites-available/default /etc/apache2/sites-available/phpmyadmin
    //change the default path to /var/www/phpmyadmin
    
    11.Install jinzhao.me 
    :wget http://cn.wordpress.org/wordpress-3.7-zh_CN.tar.gz
    :tar -xzvf wordpress-3.7-zh_CN.tar.gz
    :mv wordpress /var/www/jinzhao.me
    //config through jinzhao.me on browser
    //
  • 相关阅读:
    浅析uitableview
    ios9和xcode7的适配问题
    uiviewContentMode的介绍 转载
    关于常见的加密算法浅析
    程序中发起电话呼叫
    单例实现方式以及类方法和实例方法
    windows下的git的安装教程
    上传github项目
    android 使用SurfaceView绘制一个简单动画控件
    android 自定义控件属性获取bitmap和drawable的绘制
  • 原文地址:https://www.cnblogs.com/jinzhao/p/3389466.html
Copyright © 2020-2023  润新知