Install Apache, MariaDB And PHP In FreeBSD10
This tutorial describes how to install AMP(Apache, MariaDB, PHP) server in FreeBSD 10.
We assume you have the FreeBSD Ports Collection installed. If not, do:
portsnap fetch portsnap extract
If the Ports Collection is already installed, update it with :
portsnap fetch update
Okay, let’s begin the installation of the componments
Navigate to the Apache server port and build it:
cd /usr/ports/www/apache24 make install clean
Edit /etc/rc.conf so that the Apache server will start automatically at system boot.
echo 'apache24_enable="YES"' >> /etc/rc.conf
start Apache an check with http://IP-address.
Install MariaDB Database Server
cd /usr/ports/databases/mariadb55-server make config ; make install clean
Edit rc.conf to start MariaDB at boot:
# vi /etc/rc.conf ...
# add mysql_enable mysql_enable="YES"
Now start MariaDB:
# service mysql-server start
Setup grant tables:
# cd /usr/local/ # mysql_install_db assumes its running from here # mysql_install_db --user=mysql
Configure root password:
mysqladmin -u root password 'yournewpassword'
Grant root permission to connect remotely:
mysql -u root -p mysql> grant all privileges on *.* to 'root'@'%' identified by 'appleton' with grant option; mysql> exit;
Before we proceed to build PHP, we need to add a configuration option so that PHP build includes support for the Apache server.
cd /usr/ports/lang/php55 make config
A menu should come up allowing you to select/deselect various build options. You should select “Build Apache module”
now go ahead with setup:
make install clean
add support for both MySQL and MySQLi to to communicate with the MySQL server.
cd /usr/ports/lang/php55-extensions/ make config
In the corresponding menu you should select “MySQL database support” and “MySQLi database support”.
make install clean
Configuration of PHP
cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini
Now let’s configure Apache. Open the file /usr/local/etc/apache24/httpd.conf in your favourite editor and look for the following line:
And change it so it reads as follows:
DirectoryIndex index.html index.htm index.php
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
Now restart Apache:
To check if your php is nstalled,
add the code test.php,
cd /usr/local/www/apache24/data/ vi test.php
Add the following lines:
<?php phpinfo(); ?>
Restart apache and test:
Please note: For PhpMyadmin if you are working with php55 you will get this error:
===> pecl-APC-3.1.14_1 cannot be installed: doesn't work with lang/php55 port (doesn't support PHP 5.5). *** Error code 1
You have to Downgrade to php53 to get rid off this error, else wait till this issue be fixed by FreeBSD developers.
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Fedora 21 Scheduled For Release In October : For Fedora users, just keep calm and use Fedora 20 for now. Fedora Developers has announced that F...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install LAMP Server (Apache, MySQL or MariaDB, PHP) On Ubuntu 13.10 : Updated January 12, 2014 LAMP is a combination of operating system and open-source software stack. ...0 comments |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comments |
- DNS Server Installation Step by Step Using CentOS 6.5/6.4/6.3 : DNS, Domain Name System, translates hostnames or URLs into IP addresses. For example if we type www....0 comments |
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .