0% found this document useful (0 votes)
51 views

FAMP (FreeBSD-Apache-MariaDB-PHP)

This document provides instructions for setting up a LAMP stack on a FreeBSD server. It describes installing and configuring Apache, MariaDB, and PHP to build a basic LAMP environment. Key steps include installing each component via ports, configuring startup settings, enabling modules, creating test files, and ensuring the components can communicate. The goal is to deploy a functioning LAMP stack that can serve basic PHP applications.

Uploaded by

andy hidayat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

FAMP (FreeBSD-Apache-MariaDB-PHP)

This document provides instructions for setting up a LAMP stack on a FreeBSD server. It describes installing and configuring Apache, MariaDB, and PHP to build a basic LAMP environment. Key steps include installing each component via ports, configuring startup settings, enabling modules, creating test files, and ensuring the components can communicate. The goal is to deploy a functioning LAMP stack that can serve basic PHP applications.

Uploaded by

andy hidayat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

FAMP

FreeBSD. Apache. MariaDB. PHP

How To Build.Setup.Deploy
by m1m1n
The Introduction

● You Have A FreeBSD Box


● An Extracted Portsnap & Distfiles
● A Putty & WinSCP (Windows Users)
● A Terminal & SCP (Linux Users)
● Basic of ee/nano editor
● Basic of Unix/Linux Command Line
● A Lots of Snacks...
The Setup. Configuration. Deploy (Apache24)

Installing Apache24
# cd /usr/ports/www/apache24 && make install clean

Installing Apache24
# cd /usr/ports/www/apache24 && make install clean

Apache24 on Start up
# ee /etc/rc.conf
The Setup. Configuration. Deploy (Apache24)

apache24_enable=”YES”
apache24_http_accept_enable=”YES”
The Setup. Configuration. Deploy (Apache24)

Configure httpd.conf
# ee /usr/local/etc/apache24/httpd.conf
The Setup. Configuration. Deploy (Apache24)

Configure hosts
# ee /etc/hosts

Server ip address & Server FQDN


192.168.56.101 webserver.fsisystem.net webserver
The Setup. Configuration. Deploy (Apache24)

Enabling mod_rewrite & mod_php


Remove “hastag (#) on rewrite_module & php5_module

Starting Apache24 Service


# service apache24 start
The Setup. Configuration. Deploy (Apache24)

Testing with Browser using server ip address


It Works!
The Setup. Configuration. Deploy (MariaDB)

Installing MariaDB100-Server
# cd /usr/ports/databases/mariadb100-server
# make install clean

Adding MariaDB on Start Up


# ee /etc/rc.conf
The Setup. Configuration. Deploy (MariaDB)

MariaDB on Server Start Up


mysql_enable=”YES”

Copying my.cnf from System


# cp /usr/local/share/mysql/my-small.cnf /usr/local/etc/my.cnf
The Setup. Configuration. Deploy (MariaDB)

Starting MariaDB Service & Status


# service mysql-server start
# sockstat -4 -l

MariaDB set root password for the first time


# mysqladmin -u root password ‘passwordanda’
The Setup. Configuration. Deploy (MariaDB)

MariaDB first login


# mysql -u root -p
The Setup. Configuration. Deploy (PHP)

Installing php56
# cd /usr/ports/lang/php56 && make install clean

Installing php56 module for Apache24


# cd /usr/ports/www/mod_php56 && make install clean
The Setup. Configuration. Deploy (PHP)

Configure Apache24 for php56


# ee /usr/local/etc/apache24/httpd.conf

Adding index.php infront of index.html


DirectoryIndex index.php index.html
The Setup. Configuration. Deploy (PHP)

Adding Type Application for php56


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

Creating phpinfo.php file


# ee /usr/local/www/apache24/data/phpinfo.php
The Setup. Configuration. Deploy (PHP)

Phpinfo.php content
<?php phpinfo();

Copying php.ini from System


# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
The Setup. Configuration. Deploy (PHP)

Configure php.ini for Basic Use


# ee /usr/local/etc/php.ini

date.timezone = Asia/Jakarta
The Setup. Configuration. Deploy (PHP)

session.save_path= “/tmp”

Restarting Apache24
# Service Apache24 restart
The Setup. Configuration. Deploy (PHP)
The Credits

ALLAH SWT & Nabi Muhammad SAW

www.skyline.net.id

FSISystem

Quanta & Inspur Servers

Komunitas BelajarFreeBSD Indonesia

You might also like