блог-форум о программировании
Вы не вошли.
Страницы 1
И так, разворачиваю FreeBSD 11.1 в качестве площадки для разработок.
Первоначальная установка из iso-образа
Правка /etc/make.conf
Обновление дерева портов и установка Midnight Commander
Заменяем для рута редактор по-умолчаниб с vi на mcediror
Заменяем шелл на bash для пользователей
Правка авторизации по SSH
Правка локали и шрифтов системной консоли
Пересборка ядра
Прописка правил фаервола
Установка и настройка XOrg & xfce4
Установка и настройка PostgreSQL 9.6
Установка и настройка MySQL 5.7
Установка Apache 2.4.27 и PHP 7.1.8
Установка и настройка Qt 5.5.1
Установка MXE
"Нарезаем" загрузочную флешку. Изначально - все по сценарию, клавиатура koi8-r, файловая система ZFS автоматом, два HDD (в режиме ACHI) в stripped, игры исключаем, автозапуск sshd обязательно.
Сетевые настройки (в /etc/resolv.conf используем поисковый домен - loc), настройки пользователя (включить в группу wheel обязательно). Запуск ssh-клиента (putty), подключение пользователем, запуск команды su. Здесь и далее - пользуемся редактором ee.
Небольшой тюнинг процессов сборки:
ee /etc/make.conf
CPUTYPE?=core-avx-i
MAKE_JOBS_NUMBER?=3
WITH=ICONV
WITHOUT_DEBUG=YES
portsnap fetch extract
pkg install misc/mc
pkg install shells/bash
pkg install shells/bash-completion
Правим /root/.profile
...
EDITOR=mcedit; export EDITOR
...
Правим /root/.cshrc
...
setenv EDITOR mcedit
...
Релогаемся рутом.
Bash ставим по причине отсутствия сабшелла у пользователей, отличных от рута, в Midnight Commander'е
chsh <пользователь>
Путь к bash'у - /usr/local/bin/bash
А в /home/пользователь/.profile добавляем:
[[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \
source /usr/local/share/bash-completion/bash_completion.sh
В файле /etc/ssh/sshd_config раскоментируем строчку:
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
В домашнем каталоге создаем файл ключей:
mkdir -p ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0744 ~/.ssh
chmod 0644 ~/.ssh/authorized_keys
Сперва добавим в /etc/login.conf следующие строки:
utf8|UTF-8 Users Accounts:\
:charset=UTF-8:\
:lang=en_US.UTF-8:\
:tc=default:
utf8r|Russian UTF-8 Users Accounts:\
:charset=UTF-8:\
:lang=ru_RU.UTF-8:\
:tc=default:
postgres:\
:lang=en_US.UTF-8:\
:setenv=LC_COLLATE=C:\
:tc=default:
Далее, для пользователя root и majestio (тут и далее - выбираете своего) прописываем:
cap_mkdb /etc/login.conf
pw usermod -n root -L utf8
pw usermod -n majestio -L utf8r
Выкачиваем шрифты terminus на выбор в каталог /usr/share/vt/fonts/:
cd /usr/share/vt/fonts/
fetch http://majestio.info/stuff/ter-u16.fnt
Прописываем нужный в /etc/rc.conf, и за одно переключение Рус/Лат по Ctrl-Shift:
font8x16="ter-u16.fnt"
keymap="ru.win"
А в /boot/loader.conf прописываем:
hw.vga.textmode=0
kern.vty=vt
kern.maxfiles=65535
Пересобираем ядро согласно Хэндбуку. На этапе редактирования конфигурации ядра надо проверить наличие следующих параметров (согласно /usr/local/share/doc/postgresql/README-server), при необходимости добавить/изменить:
# PostgreSQL
options SYSVSHM # как правило
options SYSVSEM # сейчас эти опции
options SYSVMSG # в ядре по умолчанию
options SHMMAXPGS=65536
options SEMMNI=40
options SEMMNS=240
options SEMUME=40
options SEMMNU=120
# Firewall
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=5
options DEVICE_POLLING
options TEKEN_UTF8
Собственно процесс пересборки (исходное работоспособное ядро положим в /boot/kernel.good):
cp -R /boot/kernel /boot/kernel.good
cd /usr/src/sys/amd64/conf
cp GENERIC MYKERNEL
ee MYKERNEL
cd /usr/src
make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL
Для корректной работы powerd необходимо изменить /boot/device.hint
hint.acpi_throttle.0.disabled="0"
hint.p4tcc.0.disabled="0"
Не перегружаясь, настраиваем фаервол. Для этого добавим строки в /etc/rc.conf
firewall_enable="YES"
firewall_type="closed"
firewall_script="/etc/ipfw.rules"
И создадим файл /etc/ipfw.rules следующего содержания:
#!/bin/sh
################ Начало файла с правилами IPFW ##################
# Сброс всех правил перед началом работы скрипта.
ipfw -q -f flush
# Префикс для создания правил
cmd="ipfw -q add" # команда добавления правил
eth="re0" # название интерфейса
gw="192.168.1.1" # адрес шлюза
#################################################################
# Нет ограничений на внутреннем интерфейсе локальной сети
# Нет необходимости в этом, если у вас нет локальной сети.
# Замените xl0 на название интерфейса вашей локальной сети
#################################################################
$cmd 00005 allow all from any to any via $eth
#################################################################
# Нет ограничений на интерфейсе Loopback
#################################################################
$cmd 00010 allow all from any to any via lo0
#################################################################
# Разрешить пакет, если он был ранее добавлен в "динамическую"
# таблицу при помощи выражения allow keep-state
#################################################################
$cmd 00015 check-state
#################################################################
# Раздел правил для исходящего трафика на внешнем интерфейсе
#################################################################
# Разрешить исходящий трафик к DNS серверу (DNS-на шлюзе)
$cmd 00110 allow tcp from any to $gw 53 out via $eth setup keep-state
$cmd 00111 allow udp from any to $gw 53 out via $eth keep-state
# Разрешить исходящий трафик для незащищенного www соединения
$cmd 00200 allow tcp from any to any 80 out via $eth setup keep-state
# Разрешить исходящий трафик для защищенного www соединения
# https с поддержкой TLS и SSL
$cmd 00220 allow tcp from any to any 443 out via $eth setup keep-state
# Разрешить исходящий POP/SMTP
$cmd 00230 allow tcp from any to any 25 out via $eth setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $eth setup keep-state
# Разрешить исходящий трафик для FreeBSD (make install & CVSUP)
# По сути назначаем пользователю root полные привилегии.
$cmd 00240 allow tcp from me to any out via $eth setup keep-state uid root
# Разрешаем исходящий icmp ping
$cmd 00250 allow icmp from any to any out via $eth keep-state
# Разрешаем исходящий трафик Time
$cmd 00260 allow tcp from any to any 37 out via $eth setup keep-state
# Разрешаем исходящий трафик nntp news
$cmd 00270 allow tcp from any to any 119 out via $eth setup keep-state
# Разрешаем исходящий защищённый трафик FTP, Telnet и SCP
# Эта функция использует SSH (secure shell)
$cmd 00280 allow tcp from any to any 22 out via $eth setup keep-state
# Разрешаем исходящий трафик whois
$cmd 00290 allow tcp from any to any 43 out via $eth setup keep-state
# Запрещаем и заносим в журнал остальной исходящий трафик.
# Обеспечивает политику межсетевого экрана закрытого типа
$cmd 00299 deny log all from any to any out via $eth
#################################################################
# Раздел правил для входящего трафика на внешнем интерфейсе
#################################################################
# Запрещаем весь входящий трафик с немаршрутизируемых сетей
$cmd 00300 deny all from 192.168.0.0/16 to any in via $eth # RFC 1918 private IP
$cmd 00301 deny all from 172.16.0.0/12 to any in via $eth # RFC 1918 private IP
$cmd 00302 deny all from 10.0.0.0/8 to any in via $eth # RFC 1918 private IP
$cmd 00303 deny all from 127.0.0.0/8 to any in via $eth # loopback
$cmd 00304 deny all from 0.0.0.0/8 to any in via $eth # loopback
$cmd 00305 deny all from 169.254.0.0/16 to any in via $eth # DHCP auto-config
$cmd 00306 deny all from 192.0.2.0/24 to any in via $eth # reserved for docs
$cmd 00307 deny all from 204.152.64.0/23 to any in via $eth # Sun cluster interconnect
$cmd 00308 deny all from 224.0.0.0/3 to any in via $eth # Class D & E multicast
# Запрещаем пинг извне
$cmd 00310 deny icmp from any to any in via $eth
# Запрещаем ident
$cmd 00315 deny tcp from any to any 113 in via $eth
# Запрещаем все Netbios службы. 137=name, 138=datagram, 139=session
# Netbios это MS/Windows сервис обмена.
# Блокируем MS/Windows hosts2 запросы сервера имен на порту 81
$cmd 00320 deny tcp from any to any 137 in via $eth
$cmd 00321 deny tcp from any to any 138 in via $eth
$cmd 00322 deny tcp from any to any 139 in via $eth
$cmd 00323 deny tcp from any to any 81 in via $eth
# Запрещаем любые опоздавшие пакеты
$cmd 00330 deny all from any to any frag in via $eth
# Запрещаем ACK пакеты, которые не соответствуют динамической таблице правил.
$cmd 00332 deny tcp from any to any established in via $eth
# Разрешить входящий трафик для www, так как я использую сервер apache
$cmd 00400 allow tcp from any to me 80 in via $eth setup limit src-addr 2
# Разрешить входящий трафик безопасных FTP, Telnet и SCP из глобальной сети
$cmd 00410 allow tcp from any to me 22 in via $eth setup limit src-addr 2
# Разрешить входящий трафик PostgreSQL & MySQL
$cmd 00430 allow tcp from any to me 5432 in via $eth setup limit src-addr 2
$cmd 00431 allow tcp from any to me 3306 in via $eth setup limit src-addr 2
# Отбрасываем и заносим в журнал все входящие соединения снаружи
$cmd 00499 deny log all from any to any in via $eth
# Всё остальное запрещено по умолчанию
# Запрещаем и заносим в журнал все пакеты для дальнейшего анализа
$cmd 00999 deny log all from any to any
################ Конец файла правил IPFW ########################
Теперь можно перегружаться
reboot
Лень все собирать, будем ставить из пакетов:
pkg install x11/xorg
pkg install x11-drivers/xf86-video-vmware # для работы под VMWare
pkg install open-vm-tools # для работы под VMWare
В /etc/rc.conf:
tcsd_enable="YES"
tcsd_mode="emulator"
tpmd_enable="YES"
pkg install x11-wm/xfce4
Edit /usr/local/etc/openldap/ldap.conf - если надо
Edit /etc/sysctl.conf kern.maxfiles="25000"
Edit /usr/local/etc/smb4.conf
>>> Разобрать сообщения от pkg:
Message from libsoup-2.74.0:
--
libsoup can use NTLM authentication if it is compiled
with the SMB option. To use it, you must install a
port that provides NTLM, like net/samba412 or net/samba413.
=====
Message from libgtop-2.40.0:
--
In order to use the File System read/write monitor, you must chmod
/dev/devstat so that all users can open it read-only. For example:
# chmod 0444 /dev/devstat
In order for this to persist across reboots, add the following to
/etc/devfs.conf:
perm devstat 0444
=====
Message from cyrus-sasl-2.1.27_2:
--
You can use sasldb2 for authentication, to add users use:
saslpasswd2 -c username
If you want to enable SMTP AUTH with the system Sendmail, read
Sendmail.README
NOTE: This port has been compiled with a default pwcheck_method of
auxprop. If you want to authenticate your user by /etc/passwd,
PAM or LDAP, install ports/security/cyrus-sasl2-saslauthd and
set sasl_pwcheck_method to saslauthd after installing the
Cyrus-IMAPd 2.X port. You should also check the
/usr/local/lib/sasl2/*.conf files for the correct
pwcheck_method.
If you want to use GSSAPI mechanism, install
ports/security/cyrus-sasl2-gssapi.
If you want to use SRP mechanism, install
ports/security/cyrus-sasl2-srp.
If you want to use LDAP auxprop plugin, install
ports/security/cyrus-sasl2-ldapdb.
=====
Message from openldap24-client-2.4.59_2:
--
The OpenLDAP client package has been successfully installed.
Edit
/usr/local/etc/openldap/ldap.conf
to change the system-wide client defaults.
Try `man ldap.conf' and visit the OpenLDAP FAQ-O-Matic at
http://www.OpenLDAP.org/faq/index.cgi?file=3
for more information.
=====
Message from libinotify-20180201_2:
--
Libinotify functionality on FreeBSD is missing support for
- detecting a file being moved into or out of a directory within the
same filesystem
- certain modifications to a symbolic link (rather than the
file it points to.)
in addition to the known limitations on all platforms using kqueue(2)
where various open and close notifications are unimplemented.
This means the following regression tests will fail:
Directory notifications:
IN_MOVED_FROM
IN_MOVED_TO
Open/close notifications:
IN_OPEN
IN_CLOSE_NOWRITE
IN_CLOSE_WRITE
Symbolic Link notifications:
IN_DONT_FOLLOW
IN_ATTRIB
IN_MOVE_SELF
IN_DELETE_SELF
Kernel patches to address the missing directory and symbolic link
notifications are available from:
https://github.com/libinotify-kqueue/li … er/patches
You might want to consider increasing the kern.maxfiles tunable if you plan
to use this library for applications that need to monitor activity of a lot
of files.
=====
Message from gamin-0.1.10_10:
--
Gamin will only provide realtime notification of changes for at most n files,
where n is the minimum value between (kern.maxfiles * 0.7) and
(kern.maxfilesperproc - 200). Beyond that limit, files will be polled.
If you often open several large folders with Nautilus, you might want to
increase the kern.maxfiles tunable (you do not need to set
kern.maxfilesperproc, since it is computed at boot time from kern.maxfiles).
The behavior of gamin can be controlled via the various gaminrc files.
See http://www.gnome.org/~veillard/gamin/config.html on how to create
these files. In particular, if you find gam_server is taking up too much
CPU time polling for changes, something like the following may help
in one of the gaminrc files:
# reduce polling frequency to once per 10 seconds
# for UFS file systems in order to lower CPU load
fsset ufs poll 10
--
===> NOTICE:
The gamin port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:
https://bugs.freebsd.org/bugzilla
More information about port maintainership is available at:
https://docs.freebsd.org/en/articles/co … ntributing
=====
Message from libexo-4.16.2:
--
If you are upgrading your packages, due to a problem with the pkg
package management tool libexo requires to be upgraded by itself
before the rest of packages, to ensure correct installation, as
described in UPDATING entry 20210102.
If you skipped the manual step and XFCE parts are failing due to
missing libraries, please run "pkg upgrade -f libexo" to force
reinstalling the missing parts.
=====
Message from libdbusmenu-16.04.0_3:
--
===> NOTICE:
The libdbusmenu port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:
https://bugs.freebsd.org/bugzilla
More information about port maintainership is available at:
https://docs.freebsd.org/en/articles/co … ntributing
=====
Message from samba412-4.12.15_2:
--
How to start: http://wiki.samba.org/index.php/Samba4/HOWTO
* Your configuration is: /usr/local/etc/smb4.conf
* All the relevant databases are under: /var/db/samba4
* All the logs are under: /var/log/samba4
* Provisioning script is: /usr/local/bin/samba-tool
For additional documentation check: http://wiki.samba.org/index.php/Samba4
Bug reports should go to the: https://bugzilla.samba.org/
=====
Message from libbluray-1.3.0,1:
--
===> NOTICE:
The libbluray port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:
https://bugs.freebsd.org/bugzilla
More information about port maintainership is available at:
https://docs.freebsd.org/en/articles/co … ntributing
=====
Message from xfce4-tumbler-4.16.0_9:
--
To override the default configuration, you must copy the rc-file:
mkdir ~/.config/tumbler
cp /usr/local/etc/xdg/tumbler/tumbler.rc ~/.config/tumbler
The COVER plugin requires manual configuration.
For more information see http://docs.xfce.org/xfce/thunar/tumbler
=====
Message from xfce4-terminal-0.8.10_2:
--
Some options could need manual change to ~/.config/xfce4/terminal/terminalrc:
To reduce the height of tabs, add the hidden 'MiscSlimTabs' option:
MiscSlimTabs=TRUE
By default this option is not defined.
If you have configured a custom color cursor you will also need to add:
ColorCursorUseDefault=FALSE
to have such configuration still working, otherwise reconfigure the color
in the GUI.
Keep in mind, when you change an option in Preferences window, this file
is overwritten.
=====
Message from xfce4-session-4.16.0:
--
To be able to shutdown or reboot your system, you'll have to add .rules
files in /usr/local/etc/polkit-1/rules.d directory. Which looks
like this (replace PUTYOURGROUPHERE by your group):
polkit.addRule(function (action, subject) {
if ((action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop")
&& subject.isInGroup("PUTYOURGROUPHERE")) {
return polkit.Result.YES;
}
});
For those who have working suspend/resume:
polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.consolekit.system.suspend"
&& subject.isInGroup("PUTYOURGROUPHERE")) {
return polkit.Result.YES;
}
});
This port installs a startup file for xscreensaver but it is
disabled by default. This is so because the XFCE metaport
installs xfce4-screensaver to autostart and having both enabled
causes conflicts.
If you want to change the screen saver being used and enable
xscreensaver please go to the Session and Startup settings, and in
the Application Autostart tab enable only the relevant screensaver:
Screensaver -> to enable xscreensaver
XFCE Screensaver -> to enable xfce4-screensaver
pkg install x11/xfce4-quicklauncher-plugin
pkg install x11/xfce4-taskmanager
pkg install x11/xfce4-clipman-plugin
pkg install x11/xfce4-dashboard
pkg install x11/xfce4-embed-plugin
pkg install x11/xfce4-screenshooter-plugin
pkg install x11/xfce4-verve-plugin
pkg install x11/xfce4-whiskermenu-plugin
pkg install x11/xfce4-wmdock-plugin
pkg install mail/xfce4-mailwatch-plugin
pkg install misc/xfce4-weather-plugin
pkg install misc/xfce4-wm-themes
pkg install sysutils/xfce4-mount-plugin
pkg install x11-clocks/xfce4-datetime-plugin
Создаем конфигурационный файл X11 /etc/X11/xorg.conf следующего содержания:
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/local/lib/xorg/modules"
FontPath "/usr/local/share/fonts/programmer/"
FontPath "/usr/local/share/fonts/cyrillic/"
FontPath "/usr/local/share/fonts/TrueType/"
FontPath "/usr/local/share/fonts/misc/"
FontPath "/usr/local/share/fonts/OTF/"
FontPath "/usr/local/share/fonts/TTF/"
FontPath "/usr/local/share/fonts/Type1/"
FontPath "/usr/local/share/fonts/75dpi/"
FontPath "/usr/local/share/fonts/100dpi/"
FontPath "/usr/local/share/fonts/dejavu/"
FontPath "/usr/local/share/fonts/util/"
EndSection
Section "Module"
Load "dbe"
Load "dri"
Load "dri2"
Load "extmod"
Load "glx"
Load "record"
Load "freetype"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "evdev"
Option "XkbModel" "pc105"
Option "XkbLayout" "us,ru"
Option "XkbOptions" "compose:lwin,grp:lctrl_lshift_toggle,numpad:microsoft,ctrl:nocaps"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "vmmouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "vmware"
VendorName "VMware, Inc"
HorizSync 30-100
VertRefresh 56-120
EndSection
Section "Device"
Identifier "VMware SVGA"
Driver "vmware"
BusID "PCI:0:15:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "VMware SVGA"
Monitor "vmware"
EndSection
И добавляем в /etc/rc.conf:
moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
# kdm4_enable="YES" <-- по желанию сразу логин в иксах, но лучче не надо
vmware_guest_vmblock_enable="YES"
vmware_guest_vmhgfs_enable="YES"
vmware_guest_vmmemctl_enable="YES"
vmware_guest_vmxnet_enable="YES"
vmware_guestd_enable="YES"
создаем скрипт здя запуска xfce4
echo "exec startxfce4" > /home/<user>/.xinitrc
Небольшие косметические правки для лучшего отображения шрифтов на LCD-экране:
cd /usr/ports/print/freetype
make -DWITH_LCD_FILTERING deinstall reinstall
# тут в меню конфигурации порта выбираем все опции
cd /usr/ports/print/freetype2
make deinstall reinstall
The environment variable "FREETYPE_PROPERTIES" can be used to control the
driver properties. Example:
FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1
Копируем свои шрифты в /usr/local/share/fonts/programmer и индексируем:
cd /usr/local/share/fonts/programmer
ttmkfdir -o fonts.dir
mkfontdir /usr/local/share/fonts/programmer
fc-cache -f
В иксах ...
xset fp+ /usr/local/share/fonts/programmer
xset fp rehash
pkg install databases/postgresql96-server
pkg install databases/postgresql96-contrib
pkg install databases/postgresql96-plperl
mkdir -p /mnt/tree/pgsql/data
cd /mnt/tree
chown -R postgres:postgres pgsql
В файл /etc/rc.conf дописываем
postgresql_enable="YES"
postgresql_data="/mnt/tree/pgsql/data"
postgresql_flags="-w -s -m fast"
postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C --locale=ru_RU.UTF-8"
postrgesql_class="russian-koi8r"
postgresql_class="postgres"
Выполняем инициализацию базы
/usr/local/etc/rc.d/postgresql initdb
В файл /mnt/tree/pgsql/data/pg_hba.conf дописываем строчку - разрешения доступа по сети 192.168.1.0:
host all all 192.168.1.0/24 trust
В файле /mnt/tree/pgsql/data/postgresql.conf находим и изменяем строчки:
listen_addresses='*' # принимать соединения на любом интерфейсе
lc_messages='C' # вывод сообщений с английской локалью
service postgresql start
psql --username=postgres
createlang plperl
ALTER USER "postgres" WITH PASSWORD 'new_password';
\q
pkg install databases/mysql57-server
mkdir -p /mnt/tree/mysql/data
mkdir -p /mnt/tree/mysql/temp
mkdir -p /mnt/tree/mysql/mysql-files
cd /mnt/tree
chmod -R 750 mysql
chown -R mysql:mysql mysql
Правим /usr/local/etc/mysql/my.cnf на:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt = \u@\h [\d]>\_
no_auto_rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
bind-address = 192.168.1.18
basedir = /usr/local
datadir = /mnt/tree/mysql/data
tmpdir = /mnt/tree/mysql/temp
slave-load-tmpdir = /mnt/tree/mysql/temp
secure-file-priv = /mnt/tree/mysql/mysql-files
log-bin = mysql-bin
log-output = TABLE
master-info-repository = TABLE
relay-log-info-repository = TABLE
relay-log-recovery = 1
slow-query-log = 1
server-id = 1
sync_binlog = 1
sync_relay_log = 1
binlog_cache_size = 16M
expire_logs_days = 30
default_password_lifetime = 0
enforce-gtid-consistency = 1
gtid-mode = ON
safe-user-create = 1
lower_case_table_names = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options = BACKUP,FORCE
open_files_limit = 32768
table_open_cache = 16384
table_definition_cache = 8192
net_retry_count = 16384
key_buffer_size = 256M
max_allowed_packet = 64M
query_cache_type = 0
query_cache_size = 0
long_query_time = 0.5
innodb_buffer_pool_size = 1G
innodb_data_home_dir = /mnt/tree/mysql/data
innodb_log_group_home_dir = /mnt/tree/mysql/data
innodb_data_file_path = ibdata1:128M:autoextend
innodb_temp_data_file_path = ibtmp1:128M:autoextend
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
innodb_log_buffer_size = 16M
innodb_write_io_threads = 8
innodb_read_io_threads = 8
innodb_autoinc_lock_mode = 2
skip-symbolic-links
[mysqldump]
max_allowed_packet = 256M
quote_names
quick
cd /mnt/tree/mysql/data
/usr/local/libexec/mysqld --initialize --user=mysql
Запоминаем пароль для рута (например &jRYIYaqd3Y6)
в /etc/rc.conf добавляем:
mysql_enable="YES"
mysql_dbdir="/mnt/tree/mysql/data"
service mysql-server start
mysql -u root -p
используем запомненный пароль для рута
в оболочке mysql выполняем:
[pre]ALTER USER 'root'@'localhost' IDENTIFIED BY '<новы-пароль-рута>';
CREATE USER 'user'@'%' IDENTIFIED BY '<пароль-юзера>' PASSWORD EXPIRE NEVER;
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%';
\q
pkg install www/apache24
pkg install lang/php71
pkg install lang/php71-extensions
собираем названия всех пакетов, удаляем промежуточные каталоги и прописываем впесто /usr/ports/ -> pkg install[пробел]
find /usr/ports -type d | grep php71 | sed 's%/usr/ports/%pkg install %g' | sed '/\/files/d' > ~/php-pkg.txt
Проверяем что установлено
pkg install archivers/php71-phar
pkg install archivers/php71-zlib - уже установлено
pkg install converters/php71-iconv - уже установлено
pkg install databases/php71-pdo
pkg install databases/php71-pdo_sqlite - уже установлено
pkg install databases/php71-sqlite3
pkg install devel/php71-json - уже установлено
pkg install devel/php71-tokenizer - уже установлено
pkg install security/php71-filter
pkg install security/php71-hash
pkg install sysutils/php71-posix - уже установлено
pkg install textproc/php71-dom - уже установлено
pkg install databases/php71-pdo_pgsql - требует меньшую версию postgresql
pkg install databases/php71-pgsql - требует меньшую версию postgresql
pkg install lang/php71-extensions - уже установлено
pkg install lang/php71 - уже установлено
pkg install textproc/php71-ctype - уже установлено
pkg install textproc/php71-simplexml - уже установлено
pkg install textproc/php71-xml - уже установлено
pkg install textproc/php71-xmlreader - уже установлено
pkg install textproc/php71-xmlwriter - уже установлено
pkg install www/php71-opcache - уже установлено
pkg install www/php71-session - уже установлено
pkg install databases/php71-dba - явно не нужно
pkg install databases/php71-interbase - явно не нужно
pkg install databases/php71-odbc
pkg install databases/php71-pdo_dblib - явно не нужно
pkg install databases/php71-pdo_firebird - явно не нужно
pkg install databases/php71-pdo_odbc - явно не нужно
pkg install ftp/php71-fastdfs
pkg install mail/php71-imap - явно не нужно
pkg install net-mgmt/php71-snmp - явно не нужно
pkg install net/php71-ldap
pkg install archivers/php71-bz2
pkg install archivers/php71-zip
pkg install converters/php71-mbstring
pkg install converters/php71-recode
pkg install databases/php71-memcache
pkg install databases/php71-mysqli
pkg install databases/php71-pdo_mysql
pkg install devel/php71-gettext
pkg install devel/php71-intl
pkg install devel/php71-pcntl
pkg install devel/php71-readline
pkg install devel/php71-shmop
pkg install devel/php71-sysvmsg
pkg install devel/php71-sysvsem
pkg install devel/php71-sysvshm
pkg install ftp/php71-curl
pkg install ftp/php71-ftp
pkg install graphics/php71-exif
pkg install graphics/php71-gd
pkg install math/php71-bcmath
pkg install math/php71-gmp
pkg install misc/php71-calendar
pkg install net/php71-soap
pkg install net/php71-sockets
pkg install net/php71-xmlrpc
pkg install security/php71-mcrypt
pkg install security/php71-openssl
pkg install sysutils/php71-fileinfo
pkg install textproc/php71-enchant
pkg install textproc/php71-pspell
pkg install textproc/php71-wddx
pkg install textproc/php71-xsl
pkg install www/mod_php71
pkg install www/php71-tidy
Добавляем в /etc/rc.conf
apache24_enable="YES"
Правим /usr/local/etc/apache24/httpd.conf
Добавляем в конец файла, например
<VirtualHost *>
ServerName drupal-7.loc
DocumentRoot /mnt/tree/www/drupal-7
</VirtualHost>
<VirtualHost *>
ServerName drupal-8.loc
DocumentRoot /mnt/tree/www/drupal-8
</VirtualHost>
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
mkdir -p /mnt/tree/www/drupal-7
mkdir -p /mnt/tree/www/drupal-8
============================================================================
pkg install devel/qt5
Устанавливаем необходимый софт:
pkg install \
automake autoconf bash bison coreutils flex \
gcc gdk-pixbuf2 gettext git glib gmake gperf gsed intltool libffi \
libtool openssl p5-XML-Parser p7zip patch perl5 \
pkgconf python ruby scons unzip wget git
Переключаемся с root'а на пользователя, потом выполняем:
mkdir -p $HOME/Dev/{cross,projests,src,stuff,tools}
cd $HOME/Dev/cross
git clone https://github.com/mxe/mxe.git
cd mxe
В файле makefile найти и удалить "unzip" в секции REQUIREMENTS.
gmake MXE_TARGETS='x86_64-w64-mingw32.shared '`
'x86_64-w64-mingw32.static '`
'i686-w64-mingw32.shared '`
'i686-w64-mingw32.static '`
'x86_64-w64-mingw32.shared.posix '`
'x86_64-w64-mingw32.static.posix '`
'i686-w64-mingw32.shared.posix '`
'i686-w64-mingw32.static.posix' gcc
... продолжение не следует)
:: Мои программные ништяки ::
Вне форума
Страницы 1
[ Сгенерировано за 0.188 сек, 8 запросов выполнено - Использовано памяти: 2.44 Мбайт (Пик: 3.02 Мбайт) ]