Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 97 lines (80 sloc) 3.24 KB
#script to do
#gcin config
read -p 'Update and download packages ...'
sudo apt-get update
sudo apt-get -d install p7zip-full unrar vim openssh-server apache2 php5-cgi php5-cli php5-curl php5-gd php5-mysql awstats libgeo-ipfree-perl mysql-server phpmyadmin postfix
read -p 'Drop startx script <Enter or Ctrl+C>'
echo 'Few package set up notes:
* do set up a password for mysql
* select Satellite system for postfix
* do automatic config for apache2 on phpmyadmin'
read -p 'Download complete, now install <Enter or Ctrl+C>'
sudo apt-get install p7zip-full unrar vim openssh-server apache2 php5-cgi php5-cli php5-curl php5-gd php5-mysql awstats libgeo-ipfree-perl mysql-server phpmyadmin postfix
#echo 'postfix config...'
#read -p 'please choose Satellite system <Enter or Ctrl+C>'
#sudo dpkg-reconfigure --priority=low postfix
sudo ln /usr/sbin/sendmail /usr/bin/sendmail
#read -p 'php-cgi config... <Enter or Ctrl+C>'
#echo 'ScriptAlias /php-cgi /usr/lib/cgi-bin/php
#Action application/x-httpd-php /php-cgi' | sudo tee -a /etc/apache2/mods-available/actions.conf > /dev/null
#sudo a2enmod actions
#sudo /etc/init.d/apache2 reload
read -p 'php-cgi config (cgi and fastcgi)... <Enter or Ctrl+C>'
echo '
# Fallback to CGI if FastCGI fails
<IfModule !mod_fastcgi.c>
<IfModule mod_actions.c>
ScriptAlias /php-cgi /usr/lib/cgi-bin/php
Action application/x-httpd-php /php-cgi
</IfModule>
</IfModule>
# FastCGI conf
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
IPCConnectTimeout 20
OutputBufferSize 64
ProcessLifeTime 3600
IdleTimeout 3600
BusyTimeout 3600
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php .php
</IfModule>' | sudo tee /etc/apache2/mods-available/fcgid.conf > /dev/null
sudo a2enmod actions
sudo a2enmod fcgid
sudo /etc/init.d/apache2 reload
echo 'awstats config..'
read -p 'dont run it twice! <Enter or Ctrl+C>'
cat /usr/share/awstats/lang/awstats-tw.txt | sed -e 's/big5/utf-8/' | iconv -f big5 -t utf8 | sudo tee /usr/share/awstats/lang/awstats-tw.txt > /dev/null
cat /usr/share/awstats/lang/awstats-en.txt && echo && echo PageCode=utf-8 | sudo tee /usr/share/awstats/lang/awstats-en.txt > /dev/null
sudo ln -s /usr/share/awstats/icon /var/www/awstats-icon
head -n 4 /etc/awstats/awstats.conf.local | sudo tee /etc/awstats/awstats.conf.local > /dev/null
read -p 'mysql utf-8 config... <Enter or Ctrl+C>'
echo '[mysqld]
default-character-set = utf8
default-collation = utf8_unicode_ci
skip-character-set-client-handshake' | sudo tee /etc/mysql/conf.d/default-character-set.cnf > /dev/null
echo '[mysqld]
ft_min_word_len = 1' | sudo tee /etc/mysql/conf.d/ft_min_word_len.cnf > /dev/null
sudo /etc/init.d/mysql restart
sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin
read -p 'php5 cgi local config... <Enter or Ctrl+C>'
echo 'memory_limit = 256M
post_max_size = 2047M
upload_max_filesize = 2047M
' | sudo tee /etc/php5/conf.d/local.ini > /dev/null
echo 'Things to be done:
* apache2 config
** + ServerName localhost
** - ServerSignature On
* /etc/apache2/apache2.conf
** - ServerSignature On
** + ServerSignature Off
** - ServerTokens Full
** + ServerTokens Major
* virtual hosts
* php.ini post_max_size upload_max_filesize
** /etc/php5/cgi/php.ini
*** post_max_size = 512M
*** upload_max_filesize = 512M
* MySQL data
Bye!'