OpenBSD has been my server operating system of choice for some time now. It has a slim profile without the bloat of unneeded features and drivers that characterize most current Linux distributions. It's also known for enhanced security. While I wouldn't really consider it an "enhanced" unix, it has been designed to enforce best practices by default.
One aspect of this is that the Apache webserver is chroot jailed. This means that Apache sees /var/www as the top level directory and cannot see anything that exists outside of that particular directory tree. If you're hosting more than static html (which we all are), this can cause trouble when your scripting language (PHP/Perl/etc) needs to access another service, such as Sendmail or MySQL. You just need to configure those services to work within the security confines you've set by installing OpenBSD.
Here is one way of configuring your services so you can send mail from Apache via PHP. As always, there's more than one way to do it, and it never hurts to learn several.
First, make sure that you have set the $PKG_PATH variable correctly so that you can install packages cleanly and easily from the location of your choice (CD, FTP, etc). Now add the mini_sendmail package:
# pkg_add mini_sendmail-chroot-1.3.5
Next, create the path for sendmail within your chroot jail:
One aspect of this is that the Apache webserver is chroot jailed. This means that Apache sees /var/www as the top level directory and cannot see anything that exists outside of that particular directory tree. If you're hosting more than static html (which we all are), this can cause trouble when your scripting language (PHP/Perl/etc) needs to access another service, such as Sendmail or MySQL. You just need to configure those services to work within the security confines you've set by installing OpenBSD.
Here is one way of configuring your services so you can send mail from Apache via PHP. As always, there's more than one way to do it, and it never hurts to learn several.
First, make sure that you have set the $PKG_PATH variable correctly so that you can install packages cleanly and easily from the location of your choice (CD, FTP, etc). Now add the mini_sendmail package:
# pkg_add mini_sendmail-chroot-1.3.5
Next, create the path for sendmail within your chroot jail:
Continue reading "Sending mail from Apache via PHP in OpenBSD 3.8" »
Recent Comments