2011年7月26日

LAMP安裝備忘(Linux Apache Mysql Php) on Debian

apt-get install apache2 mysql-server php5 php5-mysql

apache2設定

編輯 /etc/apache2/apache2.conf or httpd.conf
加上 EnableSendfile Off

編輯 /etc/apache2/apache2.conf
加上 ServerName 127.0.0.1

mysql設定

編輯 /etc/mysql/my.cnf
修改 bind-address = 127.0.0.1 => #bind-address = 127.0.0.1
[mysqld]之下加入(跟效能調校有關)
max_connect_errors = 1844674407370954751
connect_timeout = 20
skip-name-resolve
slave_net_timeout = 30


建帳號、新增使用者
mysql> grant all privileges on *.* to 'vega'@'localhost' identified by 'vega' with grant option;

mysql> grant all privileges on *.* to 'vega'@'%' identified by 'vega' with grant option;

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON dbname.* to 'vega'@'%' identified by 'vega';

更新權限
mysql>flush privileges;

改密碼
mysql>update user set Password=PASSWORD('new_pass') where user='root';

MYSQL 5.7版已無Password欄位
update user set authentication_string=password('1111') where user='root';

看權限
SHOW GRANTS FOR 'vega'@'%';

2011年7月19日

SquirrelMail安裝設定備忘

執行設定程式
/usr/sbin/squirrelmail-configure

編輯 /etc/apache2/apache.conf
加入
Include /etc/squirrelmail/apache.conf

http://yourhostnameorip/



/etc/squirrelmail/config.php
$org_name = "Winpex Web Mail";
$squirrelmail_default_language = 'zh_TW';
$domain = 'mail1.winpex-gl.com';
$default_charset = 'Big5';

1.郵件列表中文出現亂碼
編輯 /usr/share/squirrelmail/config/config.php

$squirrelmail_default_language = ‘zh_TW’;
$default_charset = ‘big5′;
$lossy_encoding = false;

2.操作介面中文出現亂碼
編輯 /usr/share/squirrelmail/functions/i18n.php

$languages['zh_TW']['NAME'] = ‘Chinese Trad’;
$languages['zh_TW']['CHARSET'] = ‘big5′;
$languages['zh_TW']['LOCALE'] = array(‘zh_TW.UTF-8′, ‘zh_TW.big5′);
$languages['tw']['ALIAS'] = ‘zh_TW’;

3.下載附件中文檔名亂碼
編輯 /usr/share/squirrelmail/src/download.php
$filename = charset_encode($filename,$default_charset,false);
$filename = iconv(‘big5’,’utf-8’,$filename);