Apache · Apache 2.4 · BSD · FreeBSD · FreeBSD 11 · PHP · Web applications · Web Server · Wordpress

Installing and configuring WordPress 4 on FreeBSD 11

WordPress on FreeBSD needs a working FAMP stack. Let start off the installation by setting up a FAMP stack first. Install the FAMP stack using this link.

The following procedure is tested on FreeBSD 11

Once the installation is over, install the extra packages needed for WordPress to work with Apache, MySQL and PHP.

pkg install php56-mysqli php56-curl php56-zlib

Create a database that would be used by WordPress application and grant all privileges to appropriate user.

mysql -uroot -p
mysql> create database wordpress;
mysql> GRANT ALL ON wordpress.* TO "wpuser"@"localhost" IDENTIFIED BY "wppassword";
mysql> FLUSH PRIVILEGES;
mysql> quit

Download the latest WordPress package from the internet.

fetch https://wordpress.org/latest.tar.gz

Extract the package to the present folder.

tar -xzvf latest.tar.gz

Copy the files to /usr/local/www/apache24/data/ directory.

cp -r wordpress/* /usr/local/www/apache24/data/

Once the files are copied change directory to /usr/local/www/apache24/data/ and create a file wp-config.php from wp-config-sample.php.

cp wp-config-sample.php wp-config.php

Now edit the file wp-config.php and make the changes as follows.

define('DB_NAME', 'wordpress');
....
define('DB_USER', 'wpuser');
....
define('DB_PASSWORD', 'wppassword');

Change the ownership of all the files in this folder to ‘www’ user and ‘www’ group.

chown -R www:www .

Open the file /usr/local/etc/apache24/httpd.conf and edit the following lines

......................
    DirectoryIndex index.php

        DirectoryIndex index.php
......................
Restart Apache server.
/usr/local/etc/rc.d/apache24 restart

Now load the WordPress application in your browser using the following URL, replace with your IP.

http://<ip-address>/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s