Problems Installing Apache,PHP,MySQL on OpenBSD 4.2

11 02 2008

I knew it, OpenBSD is sooooo not user-friendly. Installing and running Apache, PHP, and MySQL on it is such a pain in the ass. Here are some problems I encountered and the solution when I installed AMP on OpenBSD 4.2:

  1.  When I installed MySQL using pkg_add mysql, the installation stopped with error can not find some libraries such as intl3.0. I found out that this errors were caused by the unmatched version of my OpenBSD and the package. I checked my system using “uname -a” and it showed that the version I used was OpenBSD 4.2-current. While the packages in the port tree is for the stable one. So you can do two things to fix this: 1. Install MySQL using port. 2. You search the library in your system that has the same name but different version with the one that is considered missing, then you link them using: “ln -s /usr/lib/somelibrary.42.so /usr/lib/somelibrary.needed-version.so”. For example, “ln -s /usr/local/lib/intl4.0.so /usr/local/lib/intl3.0.so”. (Note: it’s just an example, I forgot what library was missing :p )
  2. PhpMyAdmin can not connect to MySQL server even though all setting is right. Solution: Make sure your MySQL server is running, then try changing ‘localhost’ to ‘127.0.0.1′ in <PhpMyAdmin_directory>/config.inc.php.
  3. Error in PhpMyAdmin something about blowfish. Solution: fill the value of  ” $cfg['blowfish_secret'] = ‘<WHAT_EVER_YOU_LIKE>’;” in <PhpMyAdmin_directory>/config.inc.php.
  4. Can not run cgi-script even though you have followed all directions you got from apache documentation. It keeps giving me errors: Premature end of script headers and Can not found the script. This could be cause by several things such as wrong syntax in cgi-script, uncomplete path, or Windows line-end (there is a different between line end in Windows system and Unix system), look for it on google to find more information :D I have tried all the solutions but still didn’t work. But then I found out one more thing that can cause that error: My apache was running on chroot mode. So all you have to do is run apache without chroot mode using: “httpd -u”. Or, if you want you could try this or recompile the apache like this to run cgi-script under chroot mode. This f**king chroot has driven me crazy (pardon my language, it’s just that this goddamn chroot had wasted my precious holiday time)

Note: Someday I’ll edit this post again to mention the real complete error log :D


Actions

Information

One response

1 10 2008
Stephen Pritchard

First, I would say OpenBSD is for more expert system admins/power users then your average computer user, people who have had enough experience to read up on the software they are about to install before they install it. As they know it will save them a lot of pain in the long term.
Second, I would ask why you are were using OpenBSD 4.2-current? As this is really for system developers, the crazy brave, and fools who’ve not read the OpenBSD installation guide.
Third, chroot is a security feature, if understand why you want to use it, or if you’d prefer not to use it then use a operating system more in line with your computer skills.
Finally, not RTFM (reading the manaul) of the software before installing it wasted your holiday. OpenBSD can be installed from CD onto a blank HDU, working, with Apachectl, MySQL, PHP (including PHPMyAdmin) easily in less than 1 hour (including coffee breaks).
But then I can also see the woman in the red dress.
~ Learning can sometimes be painful, but don’t give up! ~

Leave a comment