The standard PHP4 installation that comes with Litespeed may be missing important libraries that you require for your PHP applications. Also, the bundled APC accelerator is not always enabled. Chances are that you will want to compile PHP5 and eAccelerator yourself for maximum compatibility and performance. Luckily, Litespeed has a built-in PHP compiler that simplifies this process.

First, make sure that your Dreamhost PS is temporarily set to at least 600MHz/600MB. Compiling is a CPU intensive task, and without sufficient CPU power, it will take far too long.

Next, connect to your shell account via SSH.

Download, extract, and compile autoconf and automake:
wget ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/distfiles/autoconf-2.61.tar.gz
wget ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/distfiles/automake-1.10.1.tar.bz2
tar xzf autoconf-2.61.tar.gz
tar xjf automake-1.10.1.tar.bz2
cd autoconf-2.61
./configure --prefix=$HOME
make
make install
export PATH=$PATH:$HOME/bin
cd $HOME/automake-1.10.1
./configure --prefix=$HOME
make
make install

Compile PHP5 from the Litespeed web administration interface. Note that the compile options and file paths in the below image differ from the defaults. Replace username with your user name. gettext is important for international language support, mysql is important for Wordpress, jpeg is important for image manipulation, and PEAR is not used very often. Each PHP web application has different PHP requirements, and not everything was included here, so please make sure to include the compile options that you need. If you are unsure, take a look at Dreamhost’s default compile options to see many other possibilities. In the interest of keeping a small PHP memory footprint, include only necessary compile options.
Litespeed PHP5 compile wizard
Next, we must compile eAccelerator manually. If you are compiling PHP 5.2.5, you can skip this and download the binary here.
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
tar -xjf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
export PHP_PREFIX=$HOME/lsws/lsphp5/bin
export PATH=$PATH:$HOME/bin
$PHP_PREFIX/phpize
./configure --prefix=$HOME --enable-eaccelerator-shared --with-php-config=$PHP_PREFIX/php-config
make
cp modules/eaccelerator.so $HOME

After the compile is complete and eaccelerator.so is in your /home/username/ folder, change the Command setting in Server/External App/phpLsapi from $SERVER_ROOT/fcgi-bin/lsphp to $SERVER_ROOT/fcgi-bin/lsphp5
Make a file called php.ini in your $HOME/lsws/fcgi-bin/ directory. Add these lines to enable eAccelerator.
extension_dir = "/home/username"
extension="eaccelerator.so"
eaccelerator.allowed_admin_path="/home/username"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/home/username/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="0"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="3600"
eaccelerator.shm_prune_period="3600"
eaccelerator.shm_only="1"
eaccelerator.compress="0"
eaccelerator.compress_level="1"
eaccelerator.keys = "shm_only"
eaccelerator.sessions = "shm_only"
eaccelerator.content = "shm_only"
output_buffering = On
memory_limit = 32M

Make a directory /home/username/tmp/eaccelerator and chmod those directories 777. Keep the shm_size as large as your memory will allow. Dreamhost’s NFS file mounts are slow, and we want to avoid putting cache files there. Using /tmp as the cache_dir is faster and allows a smaller shm_size to be used, but it has a capacity of only 128MB, and the server will crash if that directory runs out of space.

Now perform a graceful restart of Litespeed. That’s it! To check if everything is running as it should, create and browse to a file called phpinfo.php with these lines of code:
< ?php
phpinfo();
?>

If all is well, you should see a page titled PHP 5.2.5 that contains this line: “with eAccelerator v0.9.5.2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator.”

With the installation of PHP5 and eAccelerator, most of our speed optimizations for Litespeed are complete. Next time: final tuning of Litespeed and Dreamhost settings for lowest cost and highest stability.

Dreamhost PS

Dreamhost PS can act as a very cost effective VPS setup if you are able to configure it correctly. For $15.00 a month on top of the generous Dreamhost shared hosting plan, you can move off of the horrendously loaded shared webservers and onto a virtual private server with 150 MB RAM, 150 MB swap memory, and 150 MHz of dedicated CPU. Dreamhost’s MySQL database servers are still shared with others, but they are decent enough for most sites, and the fact that they are off-server means that they don’t use precious VPS memory.

Dreamhost Panel memory usage

Dreamhost PS’s default configuration was inherited directly from their shared hosting setup. It was slightly fiddled with but never fully optimized for low memory situations, which is what we have with Dreamhost PS. In particular, the Apache prefork threads that manage web connections to clients are compiled with libraries that you probably don’t need for your personal site. Because of this, more than 2MB of RAM are wasted per thread, and a moderately popular website usually has 30 or more threads. Also, the FastCGI settings are crude, leading to out-of-memory errors and debilitating “blocking” load from common FCGI daemons such as PHP, Perl, and Ruby.

There is much instability when running Dreamhost PS at the lowest memory settings. The easiest solution to this problem is to scale up the CPU/Memory of the Dreamhost PS server until it reaches acceptable levels, and pay extra month after month. A more cost-effective solution is to install an alternative web server behind Dreamhost’s Apache mod_proxy setup. The Litespeed web server is fast, stable, and .htaccess rewrite compatible so it’ll work straight out of the box with your Wordpress or Gallery or phpBB. Read the rest of this entry »

My freedom is the empty kind.

Yours is the freedom to choose what you want to do.

A very substantial freedom that you got from experiencing lots of hardship and pain.

You’re free to choose what you want.
That’s why you’re also free to abandon what you want.

Sawajiri Erika’s last song was the chart-topping drama theme song “Taiyou no Uta”, released under Amane Kaoru, her character’s name in the drama. “Taiyou no Uta” ended up selling 481,000 copies, making it 2006’s top-selling single by a Japanese female artist. Now going by just ERIKA, she is releasing her debut single FREE on 2007-7-4.

l_p1004883342.jpg

FREE is a song with high pop sensibilities. The rhythm is strong, and the melody is catchy. Erika’s voice constantly modulates between whispery and confident, and it is truly a captivating voice. Compared to the more acoustic Taiyou no Uta, FREE is a rockin’ song.

In the PV, Erika has changed her image. Whereas before she was snowy and pure, she is now bronzed and sexy. During the numerous scenes in which she is lying on a bed, she faintly resembles a tanned Reon Kadena.

Without the backing of a drama and with the abandonment of her image, FREE is a experiment in change. The great thing that Taiyou no Uta had was a soulful synergy between girl, drama, and song. The acoustics of FREE are nearly on par with Taiyou no Uta, but it feels like something is missing.

Still, the song sounds good, Sawajiri Erika has a major fan base, and there’s a curious air about this debut release. How far will it go up the Oricon charts (I’m guessing 125,000 copies sold)? I can’t wait to find out!

Erika - FREE lyrics:

Nee kikoeru? Kono koe ga
Furitsuzuku you ni kimi ni made tooku todoku kana?
Mou ano basho ni wa kaerenai
Kaze ni kieru negai
Kimi ga iru dake de boku wa toberu yo
Itami sasu basho e doko made mo
Tsunaide itai tsunaide itai
Mada aenakutemo inori nagara hibikiwataru sora e
Aa koko kara dakedaseru chikara ga hoshii yo
Te no hira no mirai sore dake de
Ushinatte kitamono
Te ni shita mono
Zenbu idaite hashiru
Kotae ga aru kara ima wo ikiteru
Mamoritai mono ga koko ni aru
Tatoe ima ga kioku no naka kara kiesattemo
Kimi no koto wa koko de oboeteru yo…
Itsuka deau hi ga kite
Sono te ni furerareru no nara
Yasashiku kono te wo nibiri kaeshite yo
Kimi ga iru dake de boku wa toberu yo
Kienai itami nara sono mama de
Tsunaide itai tsunaide itai itsuka aemasu you ni
Inori nagara hibikiwataru koe de
Ano hibi
I wanna be free…
Ano hibi

作詩:ERIKA・白鳥マイカ 作曲:COZZi

ねえ 聴こえる? この声が
降り続くように 君にまで遠く 届くかな?
Read the rest of this entry »

Until today, I’ve never understood the urge to travel that some people have. To me, traveling is like buying a new gadget. Travel is amusing, fun, and memorable, but it’s also emotionally destitute and money gobbling. Travel is like “Lost in Translation” before Bob met Charlotte. During trip planning, I feel like I’ve already exhausted half the experience from researching the destination. So usually there’s no motivation to travel.

hm3SVol.37_089.jpg

But today, I want to go to California, because Hirano Aya is going to sing at the Anime Expo there on 6-29. I’ll probably be able to find a recording of the performance on the web afterwards, but I still want to be there. Maybe it’s because there’s some sort of significance in seeing her in 3D for the first time. Maybe it’s because she’s an idol. Maybe.. I don’t know.

Every place becomes a mirror of yourself. Traveling is not about the places you go or the things you see, but the ways in which you change.

Incidentally, the Apple iPhone is also going to be released on 6-29.


Purple Haze, by borealnz

« Previous EntriesNext Entries »