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
//

 

你可能感兴趣的:(ubuntu)