phpMyAdmin

Always do these two commands first:

sudo apt-get update
sudo apt-get upgrade

To install phpmyadmin you have two options
1. install from the source:

sudo apt-get install phpmyadmin

That’s it, but the version is not so up-to-date.

2. Manually install:
download it last edition from the homepage. Select the “all language version” if you want to use it in other than English later.
update it to the root folder of your website.
unzip it

unzip phpMyAdmin*.zip

then follow the official docs to install it.

This will give you the last version.

Tips:
To remove the warning: mcrypt module is missing (something like that…)

sudo apt-get install php5-mcrypt
sudo /etc/init.d/apache2 restart

To remove the warning: The configuration file now needs a secret passphrase (blowfish_secret).

cd /the_path_to_your_phpmyadmin_folder/
sudo nano config.ini.php

add the follow codes before the ?> replace the password to your own random password.

$cfg[‘blowfish_secret’] = ‘password

To remove the warning:The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.

creat a datebase named phpmyadmin, create a user in the privileges tab. Username should be phpmyadmin, choose the option of “Create database with same name and grant all privileges”.

Then import the create_tables.sql from the example folder of phpmyadmin.

replace the config.inc.php with the config.sample.inc.php from the sample folder.

remove the // from the start of the following lines, change the red part with phpmyadmin and its password.

/* User used to manipulate with storage */
// $cfg[‘Servers’][$i][‘controlhost’] = ”;
// $cfg[‘Servers’][$i][‘controluser’] = ‘pma‘;
// $cfg[‘Servers’][$i][‘controlpass’] = ‘pmapass‘;

/* Storage database and tables */
// $cfg[‘Servers’][$i][‘pmadb’] = ‘phpmyadmin’;
// $cfg[‘Servers’][$i][‘bookmarktable’] = ‘pma__bookmark’;
// $cfg[‘Servers’][$i][‘relation’] = ‘pma__relation’;
// $cfg[‘Servers’][$i][‘table_info’] = ‘pma__table_info’;
// $cfg[‘Servers’][$i][‘table_coords’] = ‘pma__table_coords’;
// $cfg[‘Servers’][$i][‘pdf_pages’] = ‘pma__pdf_pages’;
// $cfg[‘Servers’][$i][‘column_info’] = ‘pma__column_info’;
// $cfg[‘Servers’][$i][‘history’] = ‘pma__history’;
// $cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma__table_uiprefs’;
// $cfg[‘Servers’][$i][‘tracking’] = ‘pma__tracking’;
// $cfg[‘Servers’][$i][‘designer_coords’] = ‘pma__designer_coords’;
// $cfg[‘Servers’][$i][‘userconfig’] = ‘pma__userconfig’;
// $cfg[‘Servers’][$i][‘recent’] = ‘pma__recent’;

To force using phpmyadmin with SSL (https):
Put this following line at the bottom of config.inc.php(before ?>)

$cfg[‘ForceSSL’] = true;

VPS 安装SSL笔记

自签名SSL就不说了,网上教程一大堆,也很简单,可以参考下文中提到的这篇Linode的官方教程
商业SSL证书按说也不难,可是网上的教程都是理想状态的,可我偏偏遇到了不理想的状况。

事情是这样的:
平台:
Linode的VPS
Debian 7
Apache
mysql
php

SSL证书提供商:
StartSSL-免费,一年有效期
RapidSSL-原价40+,域名提供商name.com给的是24刀,一年有效期
我先买了R家的,想想不划算,退款,申请了S家的,打了个电话验证就好了。

买SSL证书前请检查对应域名的联系邮箱是否有效能接收邮件,因为验证域名所有权时要用到。

我的VPS是基于Linode的教程设置为标准的LAMP系统。

然后基于这篇Linode的官方教程以及这篇StartSSL的第三方教程完成了SSL的基本配置。(中间摸索了3天T T)

拿到证书后首先将它和私匙,公匙等一堆东西打包保存到安全的地方(U盘之类的),如果像StartSSL那样登陆它后台设置页面也要相应证书的话,就也一起保存下来。请注意阅读网站说明。

下面做些自己配置的笔记以供将来参考:

首先是/etc/apache2/ports.conf
在添加 NameVirtualHost *:443 时将*替换成具体的服务器IP地址。80端口的*也一样处理。

然后再修改 /etc/apache2/sites-available/websiteurl
将已有的80端口http部分复制并在文件末尾黏贴,将80端口修改为443,并添加以下信息:

SSLEngine On
SSLCertificateFile /etc/apache2/ssl/123.crt
SSLCertificateKeyFile /etc/apache2/ssl/123.key
SSLCACertificateFile /etc/apache2/ssl/123.pem

具体对应的证书请参考上文中提到的这篇StartSSL的第三方教程

然后不需要修改default-ssl文件。

重启apache服务:

sudo service apache2 restart

附录:
证书文件格式说明,识别及转换:
https://support.ssl.com/index.php?/Knowledgebase/Article/View/19

http://httpd.apache.org/docs/2.2/mod/mod_ssl.html

https://www.sslshopper.com/ssl-converter.html

http://docstore.mik.ua/orelly/weblinux2/apache/ch11_10.htm

http://stackoverflow.com/questions/14191468/openssl-encoding-errors-while-converting-cer-to-pem

http://blog.oneiroi.co.uk/openssl/x.509/pcks7/openssl-unable-to-load-certificate-wrong-asn1-encoding-routines-asn1-check-tlen-tag-tasn-dec-dot-c-1319/

在vps上生成证书时各字段的含义:
http://willjackson.org/blog/configuring-ssl-apache-debian-or-ubuntu

解决启动apache服务时的错误:SSLEngine模块缺失(英文怎么说忘了)
估计是之前按照教程做时无意间关闭了这个模块,把它启动起来就好了:

a2enmod ssl

相关网址:http://debian-handbook.info/browse/stable/sect.http-web-server.html 其中的“GOING FURTHER Adding support for SSL”部分。

解决启动apache服务时的警告(不影响启动):Restarting web server apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

sudo nano /etc/apache2/conf.d/fqdn

输入:

ServerName localhos

再重启apache。

中文参考:
http://cnzhx.net/blog/ssl-on-lamp-on-vps/

apache无法启动请去看自己 /etc/apache2/sites-available/websiteurl 文件中定义的error.log

本站使用的wordpress插件

Delete-Revision #删除多余的自动存档版本

Google XML Sitemaps #加快google收录

Jay Access Flickr #确保flickr显示

MobilePress #自动在手机上显示移动版网站

Secure WordPress #强化Wordpress安全性

Simple Tags #增强的标签系统

Simply Exclude #控制首页显示的日志分类

Some Chinese Please! #评论强制输入至少一个中文避免垃圾评论

Tweetable #自动发布日志至twitter,并在侧边栏显示最新twitter

Tweet Import #自动采集个人的twitter作为日志发布

WordPress Database Backup #定期自动备份数据库至邮箱

WordPress Mobile Admin #手机版后台,可发布日志,管理评论

WP-MulticolLinks #更紧凑的双栏侧边栏链接

WP-PageNavi #强化底部分页导航按钮

WP-RecentComments #强化侧边栏评论栏

WP-Today #在日志页面下方显示一年前同一日期的日志标题

wp-utf8-excerpt #强化中文摘要显示

wp slug translate #自动翻译中文标题成英文,作为日志的网址,强化seo