FreeBSD

Установка и настройка веб сервера

Установка связки apache+php+mysql+mod_perl2+phpmyadmin

1. MySQL5.5

# cd /usr/ports/databases/mysql55-server/ && make install && make clean
# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
# echo 'mysql_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/mysql-server start
# mysqladmin -u root password 'passwd'
# /usr/local/etc/rc.d/mysql-server restart

2. Apache22

# cd /usr/ports/www/apache22 && make install clean
# echo 'apache22_enable="YES"' >> /etc/rc.conf

3. PHP5.x

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

4. PHP-Extensions

# cd /usr/ports/lang/php5-extensions/ && make install clean

5. Pecl+Pear+mod_perl2

# cd /usr/ports/net/pecl-geoip && make install clean
# cd /usr/ports/devel/pear && make install clean
# cd /usr/ports/databases/pear-DB && make install clean
# cd /usr/ports/www/mod_perl2 && make install clean
# cd /usr/ports/databases/p5-DBD-mysql55 && make install clean

6. Добавляем в /usr/local/etc/apache22/httpd.conf

LoadModule perl_module libexec/apache22/mod_perl.so
AddHandler cgi-script .cgi .pl

7. Настройка php.ini

# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
# chmod u+w /usr/local/etc/php.ini
# rehash

8. Чтобы понимал index.php

# replace 'DirectoryIndex index.html' 'DirectoryIndex index.html index.shtml index.htm index.php'
-- /usr/local/etc/apache22/httpd.conf

9.

# echo 'AddType application/x-httpd-php .php' >> /usr/local/etc/apache22/Includes/php-application.conf
# echo 'AddType application/x-httpd-php-source .phpsXsource' >> /usr/local/etc/apache22/Includes/php-application.conf

10. PhpMyAdmin

# cd /usr/ports/databases/phpmyadmin/  && make install clean
# cp /usr/local/www/phpMyAdmin/config.sample.inc.php /usr/local/www/phpMyAdmin/config.inc.php
# replace "'cookie'" "'http'" -- /usr/local/www/phpMyAdmin/config.inc.php
# replace "cfg['blowfish_secret'] = ''" "cfg['blowfish_secret'] = '`md5 -q /dev/random`'" -- /usr/local/www/phpMyAdmin/config.inc.php
# echo '# PHPMYADMIN AUTOCONFIG ON '`date` >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo 'Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '<Directory "/usr/local/www/phpMyAdmin/">' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '     Options Indexes MultiViews' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '     AllowOverride None' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '     Order allow,deny' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '     allow from all' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '</Directory>' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf
# echo '' >> /usr/local/etc/apache22/Includes/phpMyAdmin.conf

11. Restart Everything

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

Оставить комментарий