В моём случае была выбранна OpenBSD 4.4. Скачиваем пакеты c ftp://ftp.openbsd.org/pub/OpenBSD/4.4/packages/i386/
Код: Выделить всё
gettext-0.17.tgz jpeg-6bp3.tgz libiconv-1.12.tgz
libltdl-1.5.26.tgz libmcrypt-2.5.7p1.tgz libxml-2.6.32p1.tgz
mysql-client-5.0.51ap0.tgz mysql-server-5.0.51ap1.tgz p5-DBD-mysql-4.005.tgz
p5-DBI-1.604.tgz p5-Net-Daemon-0.43.tgz p5-PlRPC-0.2018p0.tgz
php5-core-5.2.6.tgz php5-gd-5.2.6-no_x11.tgz php5-mbstring-5.2.6.tgz
php5-mcrypt-5.2.6.tgz php5-mysql-5.2.6.tgz png-1.2.28.tgz
t1lib-5.1.0p1.tgz
Код: Выделить всё
# wget -i files.lst
Код: Выделить всё
httpd_flags=""
Прим. Masty: Нужно учесть, что chroot-окружение не видит ничего выше своего каталога. В данном случае корнем WEB сервера у нас будет /var/www/.
Устанавливаем MySQL, в процессе установки автоматически будут удовлетворенны все зависимости:
Код: Выделить всё
# pkg_add mysql-server-5.0.51ap1.tgz
Код: Выделить всё
# pkg_add php5-core-5.2.6.tgz
# ln -s /var/www/conf/modules.sample/php5.conf /var/www/conf/modules
Библиотека для работы с изображениями:
Код: Выделить всё
# pkg_add php5-gd-5.2.6-no_x11.tgz
# ln -fs /var/www/conf/php5.sample/gd.ini /var/www/conf/php5/gd.ini
Код: Выделить всё
# pkg_add php5-mbstring-5.2.6.tgz
# ln -fs /var/www/conf/php5.sample/mbstring.ini /var/www/conf/php5/mbstring.ini
Код: Выделить всё
# pkg_add php5-mcrypt-5.2.6.tgz
# ln -fs /var/www/conf/php5.sample/mcrypt.ini /var/www/conf/php5/mcrypt.ini
Код: Выделить всё
# pkg_add php5-mysql-5.2.6.tgz
# ln -fs /var/www/conf/php5.sample/mysql.ini /var/www/conf/php5/mysql.ini
Код: Выделить всё
# mkdir -p -m 777 /var/www/tmp/
Код: Выделить всё
# mkdir -p -m 777 /var/www/var/run/
Код: Выделить всё
if [ -x /usr/local/bin/mysqld_safe ] ; then
/usr/local/bin/mysqld_safe > /dev/null 2>&1 &
echo -n ' mysql'
fi
Код: Выделить всё
# ./mysql_install_db
Код: Выделить всё
# ./mysql_secure_installation
Enter current password for root (enter for none): (нажимаем Enter, т.к. по умолчанию пароля нет)
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y (Отвечаем Yes - чтобы установить новый пароль)
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y (Отвечаем Yes - чтобы удалить анонимных пользователей)
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y (Отвечаем Yes, чтобы запретить root-у удалённый вход)
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y (Отвечаем Yes, чтобы удалить тестовую базу данных)
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y (Отвечаем Yes, чтобы перезагрузить привилегии)
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Код: Выделить всё
[client]
socket = /var/www/var/run/mysql/mysql.sock
[mysqld]
socket = /var/www/var/run/mysql/mysql.sock
Код: Выделить всё
# kill -HUP `cat /var/mysql/{полное_доменное_имя_сервера}.pid`
Код: Выделить всё
# netstat -a | grep mysql
tcp 0 0 *.mysql *.* LISTEN
0xd6032428 stream 0 0 0xd601e794 0x0 0x0 0x0 /var/www/var/run/mysql/mysql.sock
Код: Выделить всё
DirectoryIndex index.html index.htm index.php
Код: Выделить всё
AddType application/x-httpd-php .php .phtml .php3 .htm .html
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.htm index.php
Код: Выделить всё
session.save_path = "/tmp"
session.cookie_path = "/tmp"