How to make Apache to rewite correctly with SSL

Well…A strange issue. It is NOT enough just to enable RewriteEngine for correctly rewrite/redirect with SSL in Apache. While I checked the rules, in HTTP, the pattern and its substitution are functional. But in HTTPS, the pattern is malfunctioned. The solution is to enable the SSLProxyEngine for Apache. After that, there are at least THREE main module options in my HTTPS configure:

SSLEngine  On
SSLProxyEngine  On
RewriteEngine  On

If you have the same problem in HTTPS, trying it. 🙂

給未來的自己

這不是歌詞XD 是補一下這兩天在Facebook上寫的文章.

是年紀到了嗎? 還是突然頓悟? 如果我有10年後火箭筒我還滿想看看那時的我是個什麼樣的人, 過著什麼樣的生活. 我希望10年後的我, 會是個勤奮工作, 喜歡研究, 享受人生, 熱愛生命的人. 但這些條件似乎有點互相抵觸的說:P

上面寫的這些, 其實只有一部份, 其實要開的條件很多, 雖然不一定能達成, 但寫給未來的自己看看也好. 哪天有時間比對一下, 就知道自己是不是過去自己想要變成的自己了.

我希望未來的自己, 一樣是能夠享受生活, 除了上班日的工作以外, 假日都能夠出外遊玩或是參加活動, 觀賞展覽.

我希望未來的自己, 能夠在研究領域裏面找到屬於自己的天地, 也能夠儘量讓工作等於生活的一部份, 開心的工作.

我希望未來的自己, 能夠遇到一個適合共度一生的人, 能夠與我分享往後的一切.

我希望未來的自己, 能夠有一個幸福的小家庭, 不需要過多的財富, 但至少要夠用就好.

我希望未來的自己, 能夠有兩個可愛的小孩, 最好是哥哥跟妹妹, 不用非常聰明, 只至少要乖乖的就好.

我希望未來的自己…

要寫的好多, 但這樣應該就足夠了, 希望2012不要變成世界末日, 我還有好多好多的心願還沒實現呢…

最近做的夢都好讓人哀傷, 都是那種醒過來之後還會想哭, 或是不舒服的夢

但再睡下去之後醒過來就忘光了, 心情也好了很多很多, 看來這是好事 🙂

模糊的印象, 但感覺都跟潛意識內的壓力有關…有飽受屈辱的, 有被鄙視的, 有做不到答應過的事情的…云云

有的夢跟以前做過的場景一樣, 有部份場景在第一次出現之後的生活內有出現過了, 有些還沒有…所以是平行宇宙的我曾經去過的地方嗎?

有些夢境是被追趕的, 但以前想飛飛不起來, 或是想跑跑不快, 但有時可以飛也可以跳了…

但不管怎樣, 夢裡面的我(或是我內心的小人), 依舊是一個死小孩, 愛鬧愛玩愛瘋狂

不過, 最近做完夢之後, 醒來心情真的好很多很多耶, 感覺輕鬆太多太多了

是因為很久沒運動了, 因為運動而有了非淺層睡眠(也不是深層, 深層不會作夢), 讓壓力釋放了嗎?

但, 我覺得小時候的我漸漸回來了.

歡迎你, 以前那個, 愛玩愛笑愛瘋狂, 陽光有活力, 什麼都不怕的我 😀

Some notes of genkernel

Here I listing some notes when I use genkernel in gentoo for the box ‘par’. The reference is Configuring the Kernel. Because I did not copy the configure file as default via # zcat /proc/config.gz > /usr/share/genkernel/arch/x86/kernel-config, the configuration will be reset every time I generated it. Because it is for some historical issue, I’ve found alternative way to it.

1
2
# cp /etc/kernels/{old kernel version} /etc/kernels/{new kernel version}
# genkernel --menuconfig all

Finally, after compiling, the bzImage, modules will be installed into corresponding directories.

Another notice is, we should check the links for the kernel in the /boot directory and the configuration in grub to avoid any configuration issues.

Upgrade Texlive from 2008 to 2010 with CJK

While upgrading the TexLive version from 2008 to 2010 in the box of ‘par’, I’ve encounter some problem of related packages: the CJK modular is the first. This blog post is to notice the solution I’ve tried where there is no guide from gentoo. The important notice is here: [solved] dev-texlive/texlive-latex-2011 fails to build. Although the discussion is about TexLive 2011, it is useful for debugging.

The steps for me to upgrade TexLive is simple: # emerge -uDN world. But I notice the error messages while compiling:

#########################################################
fmtutil: Error! Not all formats have been built successfully.
Visit the log files in directory
/var/tmp/portage/dev-texlive/texlive-langcjk-2010/work/texmf-var/web2c
for details.
#########################################################

This is a summary of all `failed’ messages:
`ptex -ini -jobname=platex -progname=platex platex.ini’ failed
* ERROR: dev-texlive/texlive-langcjk-2010 failed (compile phase):
* failed to build format texmf/fmtutil/format.texlive-langcjk.cnf
*

With the reference, the solution I’ve tried is to unmerge all the TexLive related packages and reinstall them. And it is works. Here listing some commands I’ve use.

1
2
# emerge -C texlive-langcjk texlive-latex
# qlist -I texlive

The qlist command is included by portage-utils and can be used to check which packages are Installed and corresponded to the keywords. If it is useless after un-merge the two packages, trying to use the qlist to find out all packages related and un-merge them all. And then, with the # emerge --depclean and # revdep-rebuild, we can install TexLive in a nearly clean state.

Enjoy it. 🙂

Important note before migrate to xorg-server 1.10 on Gentoo

There are some notes of migration from Gentoo’s documentation: Xorg-server 1.10 Upgrade Guide. The most important feature change in this version is:

Xorg no longer does autodetect devices using xf86-input-keyboard and xf86-input-mouse.

But it did not specify the migration procedure, it just tell us to use evdev.

The problem I’ve encountered is that after install xorg-server 1.10 and related packages re-emerged, I lost my keyboard and mouse and I can’t type anything within GDM. Fortunately, with single mode, I can stop the procedure of GDM starting and at least using console mode for problem fixing.

The recovery steps are easy.

1. Check the useless use flags in make.conf, the INPUT_DEVICES variable should contain at least evdev but keyboard and mouse.

2. Re-emerge the x11-drivers/xf86-input-evdev packages and make a whole world checking via emerge -uDN world. The second is to re-emerge x11-base/xorg-drivers at least and to check another change.

3. (Optional) Re-emerge all drivers related to xorg. We can use qlist -I -C x11-drivers/ to find out them and re-emerge by our-self.

I done the above two steps and my laptop is working. If you have the same problem or if you want to upgrade xorg, checking these tricky points.