Install lighttpd and php
- Read http://gentoo-wiki.com/HOWTO_Lighttpd and decide which USE flags you will need. Write those flags into /etc/portage/package.use. Since I plan to use fastcgi and php, I do have at least these two flags set.
- Check php installation. If php was installed but cgi USE flag was off, you have to reinstall php with "USE=cgi".
- Now install lighttpd:
# emerge -v lighttpd
- Among the few opcode cache for php, xcache is quite stable on lighttpd. So install that:
# emerge dev-php5/xcache
Configure lighttpd
- Add this line to /etc/php/cgi-php5/php.ini
cgi.fix_pathinfo=1
- Enable mod_redirect in /etc/lighttpd/lighttpd.conf, so that we can use url.redirect to redirect "hostname.com" to "www.hostname.com".
- Add virtual host setup to /etc/lighttpd/lighttpd.conf
- Restart /etc/init.d/lighttpd
Configure Xcache for php
The configuration file for xcache-php is in /etc/php/cgi-php5/ext/xcache.ini
Reference http://xcache.lighttpd.net/wiki/XcacheIni for the changing the values in xcache.ini.
On my server that has dual-xeon, I set xcache.count="5" (n+1 where n is the number of processors) to take advantage of the Splitted Cache feature.
Reference:
Recent comments
2 weeks 5 days ago
3 weeks 6 days ago
7 weeks 4 days ago
32 weeks 4 days ago
33 weeks 3 days ago
44 weeks 3 days ago
45 weeks 6 days ago
1 year 2 weeks ago
1 year 2 weeks ago
1 year 3 weeks ago