Производство фотообоев в Новосибирске. Интернет магазин фотообоев. Изготовление - один день! Каталог 10 000 изображений!
12 Март 2009

Настройка FreeBSD с нуля — Apache, PHP, MySQL, mc, webmin, proFTPd …

posted in NIX, Полезности |

freebsd

ВСЕМ ПРИВЕТ!  Ура — наконец то я победил фрюху!

Ухх … Поимел первый опыт общения с этой чудесной операционной системой — инженера КейВеба угодили блин — до этого на серверах строго Красную Шапку ставили — а тут на тебе 🙂

Даунгрейд — жестокая штучка (а что вы хотели ?! — кризис ведь — экономим) —  грубо говоря просто дали новый сервер — а конкретнее — поставили новые винты с абсолютно голой FreeBSD 7.1

В итоге почти 2 дня «знакомства» — и вроде бы (тьфу тьфу тьфу) — рабочий сервак  (правда еще думаю поднастроить придется).

Приведу ниже выдержки из настройки своей фрихи (а статьи которыми я пользовался можно найти в моих закладках на деликиоусе) — ИТАК :

  • Почему то не пускает по ssh — совместно с саппортом вычисляем, что в putty галочка в секции SSH на версии протокола стоит не там где надо (надо 2 only)
  • С интересом обнаружил, что на системе даже wget не стоит — попробовал поставить из портов — сразу не встал — гугл — оказывается в фрихе есть аналогичный инструмент fetch
  • Ставлю MC из портов  — cd /usr/ports/misc/mc && make -DWITH_SLANG install clean
  • Руссифицирую консоль и терминалы  (статейки — в закладках) + ставлю в Putty  кодировку KOI8-R. Вроде всё хорошо — по русски, но немного поработая с mc он начинает «косячить» — пока отложил решение вопроса …
  • Ставлю WEBMIN из портов  — cd /usr/ports/sysutils/webmin && make install clean
  • Поднимаю DNS сервер BIND && make install clean  —  для автозагрузки в rc.conf добавил

    но BIND так с автозагрузки и не стартует 🙁 — тоже пока отложил решение вопроса
  • Поднимаю из портов MySQL server   — cd /usr/ports/databases/mysql5-server && make install clean
  • Поднимаю из портов MySQL client   — cd /usr/ports/databases/mysql5-client && make install clean
  • Ставлю proFTPd и заливаю назад все свои бэкапы — cd /usr/ports/ftp/proftpd && make install clean
  • Устанавливаю Апач — cd /usr/ports/www/apache22 && make config && make install clean
  • Устанавливаю PHP — cd /usr/ports/lang/php5 && make config && make install clean
  • Устанавливаю PHP расширения (БЕЗ МУСКУЛА!) — cd /usr/ports/lang/php5-extensions && make config && make install clean
  • Устанавливаю MySql PHP расширение — cd /usr/ports/databases/php5-mysql && make install clean
  • Правлю конфиг апача — добавляю обработку php, ну и вообще все конфиги подправляю как нужно

вроде усё — только не забываем добавлять в rc.conf нужные демоны

Подводные камни на которых я немного запарился:

  • в Апаче по умолчанию в директиве <directory> (та что на всех распространяется) стоит Deny All — предполагается, что для каждой виртуалки нужно разрешать отдельно — строчку эту закомментил
  • В php.ini  врубить ShortOpenTags  а то конструкция <? восприниматься не будет — только <?php

вроде всё … — в целом freebsd понравилась — особенно оперативностью установки софта из портов !

Завтра продолжу с Postlinks.ru — а то разработка проекта из за гриппа да настройки сервера встала на месте … а работы то — еще не мерено !

P.S.

Понадобилось ещё PDO mysql доставить — кратко:

1. Проверим pkg_info | grep php5pdo_mysql

2. Ныряем в нужный порт cd /usr/ports/databases/php5pdo_mysql 111

3. Инсталируем make install clean

4. Ребутим индейца apachectl restart

P.P.S
Если портов в системе не оказалось (система ну очень голая была)
Первое — ставим порты
portsnap fetch
portsnap extract
portsnap update

У нас 39 комментариев на запись “Настройка FreeBSD с нуля — Apache, PHP, MySQL, mc, webmin, proFTPd …”

Почему бы Вам не высказать своем мнение! Позвольте нам узнать, что Вы думаете...

  1. 1 On 20.10.2011, Андрей said:

    Продолжаем установку мускула запускаем снова cd /usr/ports/databases/mysql51-server && make install clean и после установки наблюдаем:

    install-info —quiet /usr/local/info/mysql.info /usr/local/info/dir
    ===> Correct pkg-plist sequence to create group(s) and user(s)
    ===> Compressing manual pages for mysql-server-5.1.58
    ===> Registering installation for mysql-server-5.1.58
    ===> SECURITY REPORT:
    This port has installed the following files which may act as network
    servers and may therefore pose a remote security risk to the system.
    /usr/local/libexec/mysqld

    This port has installed the following startup scripts which may cause
    these network services to be started at boot time.
    /usr/local/etc/rc.d/mysql-server

    If there are vulnerabilities in these programs there may be a security
    risk to the system. FreeBSD makes no guarantee about the security of
    ports included in the Ports Collection. Please type ‘make deinstall’
    to deinstall the port if this is a concern.

    For more information, and contact details about the security
    status of this software, see the following webpage:
    http://www.mysql.com/
    ===> Cleaning for mysql-client-5.1.58
    ===> Cleaning for mysql-server-5.1.58

  2. 2 On 20.10.2011, Андрей said:

    Далее пытаюсь установить мускульного клиента
    набираю cd /usr/ports/databases/mysql51-client && make install clean
    и оказывается он уже установлен 🙂 (при установке сервера клиент сам подгрузился)

    Installing for mysql-client-5.1.58
    ===> Generating temporary packing list
    ===> Checking if databases/mysql51-client already installed
    ===> mysql-client-5.1.58 is already installed
    You may wish to make deinstall» and install this port again
    by make reinstall» to upgrade it properly.
    If you really wish to overwrite the old port of databases/mysql51-client
    without deleting it first, set the variable «FORCE_PKG_REGISTER»
    in your environment or the «make install» command line.
    *** Error code 1

    Stop in /usr/ports/databases/mysql51-client.

  3. 3 On 20.10.2011, Андрей said:

    Устанавливаю Апач — cd /usr/ports/www/apache22 && make config && make install clean. Опять окошки… соглашаюсь со всем по умолчанию.
    Всё ок. Идем опять rc.conf (он лежит в папке /etc/) и добавляем для автозагрузки

    apache22_enable=»YES»

    ===> Installing rc.d startup script(s)
    To run apache www server from startup, add apache22_enable=»YES»
    in your /etc/rc.conf. Extra options can be found in startup script.

    Your hostname must be resolvable using at least 1 mechanism in
    /etc/nsswitch typically DNS or /etc/hosts or apache might
    have issues starting depending on the modules you are using.
    ===> Compressing manual pages for apache-2.2.21
    ===> Registering installation for apache-2.2.21
    ===> Cleaning for autoconf-2.68
    ===> Cleaning for expat-2.0.1_2
    ===> Cleaning for apr-ipv6-devrandom-gdbm-db42-1.4.5.1.3.12_1
    ===> Cleaning for m4-1.4.16,1
    ===> Cleaning for help2man-1.40.4
    ===> Cleaning for autoconf-wrapper-20101119
    ===> Cleaning for automake-1.11.1
    ===> Cleaning for gdbm-1.9.1
    ===> Cleaning for db42-4.2.52_5
    ===> Cleaning for p5-Locale-gettext-1.05_3
    ===> Cleaning for automake-wrapper-20101119
    ===> Cleaning for apache-2.2.21

  4. 4 On 20.10.2011, Андрей said:

    Ставлю proFTPd и заливаю назад все свои бэкапы — cd /usr/ports/ftp/proftpd && make install clean
    Всё ок.
    ===> Installing rc.d startup script(s)
    ===> Compressing manual pages for proftpd-1.3.3f
    ===> Registering installation for proftpd-1.3.3f
    ===> SECURITY REPORT:
    This port has installed the following files which may act as network
    servers and may therefore pose a remote security risk to the system.
    /usr/local/sbin/proftpd

    This port has installed the following startup scripts which may cause
    these network services to be started at boot time.
    /usr/local/etc/rc.d/proftpd

    If there are vulnerabilities in these programs there may be a security
    risk to the system. FreeBSD makes no guarantee about the security of
    ports included in the Ports Collection. Please type ‘make deinstall’
    to deinstall the port if this is a concern.

    For more information, and contact details about the security
    status of this software, see the following webpage:
    http://www.proftpd.org/
    ===> Cleaning for proftpd-1.3.3f

  5. 5 On 20.10.2011, Андрей said:

    Ставим PHP5.2
    cd /usr/ports/lang/php52 && make config && make install clean
    Всё ок.
    Встал релиз php52-5.2.17_3

  6. 6 On 20.10.2011, Андрей said:

    Устанавливаю PHP расширения (БЕЗ МУСКУЛА!) —
    cd /usr/ports/lang/php52-extensions && make config && make install clean

    Всё ок. Ниже установленные расширения.

    ===> Generating temporary packing list
    ===> Checking if lang/php52-extensions already installed
    ===> Registering installation for php52-extensions-1.3_1
    ===> Cleaning for php52-ctype-5.2.17_3
    ===> Cleaning for php52-dom-5.2.17_3
    ===> Cleaning for php52-filter-5.2.17_3
    ===> Cleaning for php52-hash-5.2.17_3
    ===> Cleaning for php52-iconv-5.2.17_3
    ===> Cleaning for php52-json-5.2.17_3
    ===> Cleaning for php52-pcre-5.2.17_3
    ===> Cleaning for php52-pdo-5.2.17_3
    ===> Cleaning for php52-pdo_sqlite-5.2.17_3
    ===> Cleaning for php52-pdo_mysql-5.2.17_3
    ===> Cleaning for php52-posix-5.2.17_3
    ===> Cleaning for php52-session-5.2.17_3
    ===> Cleaning for php52-simplexml-5.2.17_3
    ===> Cleaning for php52-spl-5.2.17_3
    ===> Cleaning for php52-sqlite-5.2.17_3
    ===> Cleaning for php52-tokenizer-5.2.17_3
    ===> Cleaning for php52-xml-5.2.17_3
    ===> Cleaning for php52-xmlreader-5.2.17_3
    ===> Cleaning for php52-xmlwriter-5.2.17_3
    ===> Cleaning for mysql-client-5.1.58
    ===> Cleaning for php52-extensions-1.3_1

  7. 7 On 20.10.2011, Андрей said:

    Устанавливаю MySql PHP расширение —
    cd /usr/ports/databases/php52-mysql && make install clean

    Всё ок.

    Build complete.
    Don’t forget to run ‘make test’.
    ===> Installing for php52-mysql-5.2.17_3
    ===> php52-mysql-5.2.17_3 depends on file: /usr/local/include/php/main/php.h — found
    ===> Generating temporary packing list
    ===> Checking if databases/php52-mysql already installed
    ===> Registering installation for php52-mysql-5.2.17_3
    ****************************************************************************

    The following line has been added to your /usr/local/etc/php/extensions.ini
    configuration file to automatically load the installed extension:

    extension=mysql.so

  8. 8 On 20.10.2011, Андрей said:

    «Понадобилось ещё PDO mysql доставить — кратко:»
    Пытаюсь установить…
    cd /usr/ports/databases/php52-pdo_mysql && make install clean

    Пишет всё ок он уже установлен.

    Build complete.
    Don’t forget to run ‘make test’.
    ===> Installing for php52-pdo_mysql-5.2.17_3
    ===> php52-pdo_mysql-5.2.17_3 depends on file: /usr/local/include/php/main/php.h — found
    ===> php52-pdo_mysql-5.2.17_3 depends on file: /usr/local/lib/php/20060613/pdo.so — found
    ===> Generating temporary packing list
    ===> Checking if databases/php52-pdo_mysql already installed
    ===> php52-pdo_mysql-5.2.17_3 is already installed
    You may wish to make deinstall» and install this port again
    by make reinstall» to upgrade it properly.
    If you really wish to overwrite the old port of databases/php52-pdo_mysql
    without deleting it first, set the variable «FORCE_PKG_REGISTER»
    in your environment or the «make install» command line.
    *** Error code 1

    Stop in /usr/ports/databases/php52-pdo_mysql.

  9. 9 On 20.10.2011, Андрей said:

    Возвращаюсь к установке webmin http://gtalex.ru/nastrojka-freebsd-s-nulya-apache-php-mysql-mc-webmin-proftpd/comment-page-3#comment-15006

    Деинсталлировал webmin и установил заново команда деинсталяции:

    cd /usr/ports/sysutils/webmin && make deinstall clean

    Установил поновой

    cd /usr/ports/sysutils/webmin && make install clean

    Запускаем /usr/local/lib/webmin/setup.sh и конфигурируем webmin
    и ещё для автозагрузки webmin идём /etc/rc.conf и добавляем

    webmin_enable=»YES»

    Получил на выходе:

    After installing Webmin for the first time you should perform the following
    steps as root:

    * Configure Webmin by running /usr/local/lib/webmin/setup.sh

    * Add webmin_enable=»YES» to your /etc/rc.conf

    * Start Webmin for the first time by running /usr/local/etc/rc.d/webmin start

    The parameters requested by setup.sh may then be changed from within Webmin
    itself.

    ===> Registering installation for webmin-1.570
    ===> Cleaning for webmin-1.570

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