티스토리 뷰

FAMP(FreeBSD with Apache, MySQL and PHP)


- Apache 2.4 – Installation and Configuration

# cd /usr/ports/www/apache24/

# make install clean

 

Create a file named /boot/loader.conf or edit it if it is already present and add the following line:

accf_http_load="YES"

 

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

 

# vi /etc/rc.conf

apache24_enable="YES"

 

# /usr/local/sbin/apachectl start

# service apache24 start



- MySQL57-Server – Installation and Configuration

# cd /usr/ports/databases/mysql57-server/

# make install clean


# /usr/local/etc/rc.d/mysql-server start

# service mysql-server start


# vi /etc/rc.conf

mysql_enable="YES"

 

# mysql_secure_installation


# cp /usr/local/share/mysql/my-default.cnf /etc/my.cnf

 

# /usr/local/etc/rc.d/mysql-server restart


Remember to run mysql_upgrade the first time you start the MySQL server after an upgrade from an earlier version.

# mysql_upgrade


Initial password for first time use of MySQL is saved in $HOME/.mysql_secret

ie. when you want to use "mysql -u root -p" first you should see password in /root/.mysql_secret


# mysql -u root -p

> ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';


The default location for my.cnf has changed from "/var/db/mysql/my.cnf" to "/usr/local/etc/mysql/my.cnf".

Existing my.cnf files must be merged manually with the new default and moved to the new location. To continue using the my.cnf file at the old location, set "mysql_optfile" in /etc/rc.conf to point to the location of the existing my.cnf file.


- PHP 5.5 – Installation and Configuration

# cd /usr/ports/lang/php55/

# make install clean

 

# cd /usr/ports/www/mod_php55/

# make install clean

 

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

LoadModule php5_module          libexec/apache24/libphp5.so

DirectoryIndex          index.html index.php


AddType application/x-httpd-php .php

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


<Files ".ht*">

    Require all denied

</Files>

<Files ".*">

    Require all denied

</Files>


<DirectoryMatch "^\.|\/\.">

    Require all denied

</DirectoryMatch>


<FilesMatch "\.(?i:log|pem|crt|cer|enc|conf|cnf|sql|sh|key)$">

    Require all denied

</FilesMatch>


<FilesMatch "\.php$">

    SetHandler application/x-httpd-php

</FilesMatch>

<FilesMatch "\.phps$">

    SetHandler application/x-httpd-php-source

</FilesMatch>

 

# cd /usr/ports/lang/php55-extensions/

# make config

[x] MySQL (check)

# make install clean

 

# cp /usr/local/etc/php.ini-development /usr/local/etc/php.ini


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

expose_php = Off

(PHP 버전 정보 출력 제거)


date.timezone = Asia/Seoul


# /usr/local/sbin/apachectl restart

'Operating System > FreeBSD' 카테고리의 다른 글

nmap 설치 및 사용  (0) 2015.11.15
wget 설치 및 사용  (0) 2015.11.15
vsftpd 설치 및 설정  (0) 2015.11.13
gcc 설치 및 설정  (0) 2015.11.12
tmux 설치 및 설정  (0) 2015.10.18
python27, py-pip 설치 및 설정  (0) 2015.07.22
bash 설치 및 설정  (0) 2015.07.22
vim-tiny 설치 및 설정  (0) 2015.07.12
Portsnap  (0) 2015.07.12
FTP 설정  (0) 2015.07.05
댓글
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
링크
공지사항
Total
Today
Yesterday