How to Install WordPress on FreeBSD

Jose Velazquez
by Atlantic.Net (71posts) under Managed Server Hosting
0 Comments
Verified and Tested 08/31/15

Introduction

WordPress is a simple blogging system the helped maintain many blogs by making a simple interface that interacts with a database. Now, it has become a one of the most powerful content management systems (CMS) in the web, especially it being a free open source software. In this how-to, we will walk through the Installation of WordPress on a FreeBSD server.

Prerequisites

You need a FreeBSD server that is configured with a static IP address.

You will also need to have a FAMP stacked server. If you haven’t installed FAMP on your server click here then proceed with this tutorial.

Installing WordPress

With the following command you could find the latest version of WordPress available.

pkg search wordpress

Once you find the version of WordPress you could install it with the following command:

pkg install wordpress-4.3,1

With WordPress installed on your FreeBSD server, we need to move the files over to Apache’s web folder with the following command:

mv /usr/local/www/wordpress /usr/local/www/apache24/data/

Configuring Apache

We will need to make minor changes to the Apache configuration file to allow php files over http. Access the Apache configuration file with the following command:

nano /usr/local/etc/apache24/httpd.conf

Now, search the mime_module and add the following 2 lines under the TypesConfig etc/apache24/mime.types line.

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

It is a good idea to change the host name now, although this can be done anytime.

echo 'your.ip.add.ress    wordpress.yourdomain.tld' >> /etc/hosts

Restart Apache so we all the changes to take affect. Do this with the following command:

service apache24 restart

Creating The MySQL Database

We will need to create a Database for WordPress to function correctly. Access MySQL with the following command:

mysql -u root -p

Created the WordPress Database with the following command:

CREATE DATABASE wordpress;

We will also need to create a user so we can access the Database. This user can be created with the following command replacing mywpuser with your name and replacing ‘password’ with the password you want.

CREATE USER [email protected] IDENTIFIED BY 'password';

We must now give permission for that user to access the WordPress Database. This can be completed with the following command.

GRANT ALL PRIVILEGES ON wordpress.* TO [email protected];

Refresh the privileges in MySQL to make those permissions active.

FLUSH PRIVILEGES;

Exit your MySQL session with the following command:

exit

Finally, we need to edit WordPress’s configuration file to specify the database, user and password. Change directories to the WordPress location with the following command:

cd /usr/local/www/apache24/data/wordpress

Copy the sample configuration file and rename it wp-config.php, with the following command:

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

Now edit the Database name ‘wordpress’, ‘mywpuser’ and ‘password’. See the how it looks below:

// ** MySQL settings - You can get this info from your web host ** //
 /** The name of the database for WordPress */
 define('DB_NAME', 'wordpress');

/** MySQL database username */
 define('DB_USER', 'mywpuser');

/** MySQL database password */
 define('DB_PASSWORD', 'password');

Finally, the rest of the the installation will be completed via your web browser. Go to your web browser and type your IP address and WordPress just like the command below:

http://10.50.2.10/wordpress
This is the welcome page for WordPress on your browser in FreeBSD

This is the welcome page for WordPress on your browser in FreeBSD

What Next?

Congratulations! You now have a server with WordPress installed. Thank you for following along and feel free to check back with us for further updates.

Atlantic.Net

Atlantic.net offers managed hosting services which include a layer of business-essential managed services to your hosting packages. Contact us today for more information.

Not sure what you need?

Get a free consultation today!

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources

We use cookies for advertising, social media and analytics purposes. Read about how we use cookies in our updated Privacy Policy. If you continue to use this site, you consent to our use of cookies and our Privacy Policy.