Install apache, php5, and mysql on FreeBSD 7.2 using ports


Apache web server one of the most widely used. Apache can also be installed on freebsd. following way to install apache, PHP5, mysql the most easy to use ports.

1. Install Apache:
view plaincopy to clipboardprint?

1. # cd /usr/ports/www/apache22
2. # make install clean

# cd /usr/ports/www/apache22
# make install clean

to start just type
view plaincopy to clipboardprint?

1. # /usr/local/sbin/apachectl start

# /usr/local/sbin/apachectl start

to enable apache on boot add apache22_enable=”YES” following file /etc/rc.conf

check apache on your browser type localhost

2. Install PHP 5
view plaincopy to clipboardprint?

1. # /usr/ports/lang/php5
2. # make install clean

# /usr/ports/lang/php5
# make install clean

make sure to build Apache module is checked

add these option on file /usr/local/etc/apache22/httpd.conf
view plaincopy to clipboardprint?

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

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

create file php.ini by copy php.ini-dist
view plaincopy to clipboardprint?

1. # cd /usr/local/etc/
2. # cp php.ini-dist php.ini

# cd /usr/local/etc/
# cp php.ini-dist php.ini

and then restart apache
view plaincopy to clipboardprint?

1. # /usr/local/sbin/apachectl restart

# /usr/local/sbin/apachectl restart

create file php on /usr/local/www/apache22/data/
view plaincopy to clipboardprint?

1.

save as test.php

now test on your browser http://127.0.0.1/test.php

Install Mysql 5
view plaincopy to clipboardprint?

1. # cd /usr/ports/databases/mysql51-server
2. # make install clean

# cd /usr/ports/databases/mysql51-server
# make install clean

create database
view plaincopy to clipboardprint?

1. # /usr/local/bin/mysql_install_db

# /usr/local/bin/mysql_install_db

change owner and group as mysql
view plaincopy to clipboardprint?

1. # chown -R mysql /var/db/mysql/
2. # chgrp -R mysql /var/db/mysql/

# chown -R mysql /var/db/mysql/
# chgrp -R mysql /var/db/mysql/

run mysql daemon
view plaincopy to clipboardprint?

1. /usr/local/bin/mysqld_safe –user=mysql &

/usr/local/bin/mysqld_safe –user=mysql &

change mysql password
view plaincopy to clipboardprint?

1. /usr/local/bin/mysqladmin -u root password newpass

/usr/local/bin/mysqladmin -u root password newpass

to automatic msyql enable when boot add /etc/rc.conf:
view plaincopy to clipboardprint?

1. mysql_enable=”YES”

mysql_enable=”YES”

Install php5-mysql module
view plaincopy to clipboardprint?

1. cd /usr/ports/databases/php5-mysql
2. make install clean

cd /usr/ports/databases/php5-mysql
make install clean

create file php to check mysql
view plaincopy to clipboardprint?

1.

save as test-db.php on /usr/local/www/apache22/data/ and go to your browser http://localhost/test-db.php

Reference:

1. install mysql on http://www.marksanborn.net
2. install apache on http://www.marksanborn.net
3. faruqafif.student.fkip.uns.ac.id
4. daemonforums.org

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: