Guide on how to install Apache 1.3 with Php 5 on FreeBSD
Yes yet another guide on how to install Apache 1.3 with Php 5 on FreeBSD. There are many ways to do this. And I’m not saying my way better. But I can confirm this method has worked fine on all systems I’ve installed Apache 1.3 with php5 on.
Now we are not going to install apache ourself instead we are going to let the Php installation run the apache compilation. So therefor we are going to install Php5 first.
Apache will not prompt you for any configuration options since Php is running the installation for us. So if we want some extra options, modules etc. compiled into apache, we need to do it now by modifying apaches “Makefile” before starting the Php5 installation. So let’s add a few modules to apache now.
We will add following modules to the apache compilation “Headers, Rewrite, and Expires”
Add the following 3 lines to the bottom of the above lines:
If you want more modules compiled into apache this is the time to do it and add them to the “Makefile”
Back to Php remember Php5 is going to launch the apache compilation this is done by checking the “Build Apache Module” once the option screen for Php5 pops up.
Actually we are ready to begin, but I would like to point out that if you intend to run Squirrelmail you will need to enable “Track-Vars” when compiling Php5.
To be honest I haven’t checked lately if Squirrelmail still requires it, but there is absolutely no harm done in enabling it. Enabling track-vars is done in the same way as we added modules to the apache Makefile.
Now that everything is in place it’s time to install all of this.
Accept the default values [Screenshot] and be sure to also check the following:
Build Apache Module
Enable Sohusin protection system
Enable Zend multibyte support
Once the installation is complete add the following to /etc/rc.conf so that apache starts up after reboot.
If you don’t feel like editing the file manually you can append it to /etc/rc.conf like this.
We need a php.ini file for php to work we will use one of the defaults that came with the installation.
It’s time to put it to a test. Let’s create a phpinfo page. This is 1 line of code and can be applied like this.
Start up apache and launch phptest.php in a browser like this http://xx.xx.xx.xx/phptest.php where xx is your IP number. Once you see the phpinfo page you know things are working it’s time to adjust your httpd.conf file.