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
8 weeks 6 days ago
9 weeks 5 days ago
20 weeks 5 days ago
22 weeks 23 hours ago
30 weeks 6 days ago
31 weeks 16 hours ago
32 weeks 5 hours ago
32 weeks 6 days ago
32 weeks 6 days ago
33 weeks 17 hours ago