FreeBSD - установка программ из портов

  • warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'vote_up_down_node_access' was given in /home/allwork/public_html/includes/menu.inc on line 452.
  • warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_menu_access_node_edit' was given in /home/allwork/public_html/includes/menu.inc on line 452.
  • warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'og_broadcast_access' was given in /home/allwork/public_html/includes/menu.inc on line 452.

Возникла как-то ситуация. И с целью избежать дополнительных вопросов, в качестве примера,  ставим наиболее популярный Apache на FreeBSD из портов Многие вещи великие ГУРУ (не только FreeBSD-шные) понимают как само собой разумеется. Для новичков - каждая команда - загадка, каждое действие - магическое набивание букавок. Приведу пример, когда гуру достаточно просто убивает проблему руками нубика через аську :) может быть кому-то поможет в жизни
newbeeпоставил апач 22 из портовон говорит что установилсяно поиск дает вот такое tools# whereis apache22apache22: /usr/ports/www/apache22как его запустить ?мне просто надо запустить апач :)gurucd /usr/local/etc/rc.dgurullguruдай мне вывод последней командыnewbeeкоманды чего?gurucd /usr/local/etc/rc.dll (LL только маленькими буквами, листинг директории смотреть хочу)newbeeпротупил :)tools# lltotal 16-r-xr-xr-x 1 root wheel 4744 Aug 27 07:45 apache22-r-xr-xr-x 1 root wheel 833 Oct 28 2006 avahi-daemon.sh-r-xr-xr-x 1 root wheel 1072 Oct 28 2006 avahi-dnsconfd.sh-r-xr-xr-x 1 root wheel 622 Oct 28 2006 dbus-r-xr-xr-x 1 root wheel 1184 Oct 15 2006 exim.sh-r-xr-xr-x 1 root wheel 1046 Oct 15 2006 postfixgurucat apache22newbeeбольшой скрипт показалоguruпуляй сюды :-)newbeetools# cat apache22#!/bin/sh## $FreeBSD: ports/www/apache22/files/apache22.sh.in,v 1.1 2006/09/24 16:16:40 clement Exp $## PROVIDE: apache22# REQUIRE: NETWORKING SERVERS# BEFORE: DAEMON# KEYWORD: shutdown## Add the following lines to /etc/rc.conf to enable apache22:# apache22_enable (bool): Set to "NO" by default.# Set it to "YES" to enable apache22# apache22_profiles (str): Set to "" by default.# Define your profiles here.# apache22limits_enable (bool):Set to "NO" by default.# Set it to yes to run `limits $limits_args`# just before apache starts.# apache22_flags (str): Set to "" by default.# Extra flags passed to start command.# apache22limits_args (str): Default to "-e -C daemon"# Arguments of pre-start limits run.# apache22_http_accept_enable (bool): Set to "NO" by default.# Set to yes to check for accf_http kernel# module on start up and load if not loaded.. /etc/rc.subrname="apache22"rcvar=`set_rcvar`start_precmd="apache22_precmd"restart_precmd="apache22_checkconfig"reload_precmd="apache22_checkconfig"reload_cmd="apache22_graceful"graceful_cmd="apache22_graceful"gracefulstop_cmd="apache22_gracefulstop"configtest_cmd="apache22_checkconfig"command="/usr/local/sbin/httpd"_pidprefix="/var/run/httpd"pidfile="${_pidprefix}.pid"required_files=/usr/local/etc/apache22/httpd.conf[ -z "$apache22_enable" ] && apache22_enable="NO"[ -z "$apache22_profiles" ] && apache22_profiles=""[ -z "$apache22_flags" ] && apache22_flags=""[ -z "$apache22limits_enable" ] && apache22limits_enable="NO"[ -z "$apache22limits_args" ] && apache22limits_args="-e -C daemon"[ -z "$apache22_http_accept_enable" ] && apache22_http_accept_enable="NO"apache22_accf() { retcode=0 if checkyesno apache22_http_accept_enable then /sbin/kldstat -v | grep accf_http 2>&1 > /dev/null retcode=${?} if [ ${retcode} -ne 0 ] then /sbin/kldload accf_http 2> /dev/null retcode=${?} fi else apache22_flags="${apache22_flags} -DNOHTTPACCEPT" fi [ ${retcode} -ne 0 ] && echo "Unable to load accf_http module" return ${retcode}}load_rc_config $nameif [ -n "$2" ]; then profile="$2" if [ "x${apache22_profiles}" != "x" ]; then pidfile="${_pidprefix}.${profile}.pid" eval apache22_configfile="\${apache22_${profile}_configfile:-}" if [ "x${apache22_configfile}" = "x" ]; then echo "You must define a configuration file (apache22_${profile}_configfile)" exit 1 fi required_files="${apache22_configfile}" eval apache22_enable="\${apache22_${profile}_enable:-${apache22_enable}}" eval apache22_flags="\${apache22_${profile}_flags:-${apache22_flags}}" eval apache22_http_accept_enable="\${apache22_${profile}_http_accept_enable:-${apache22_http_accept_enable}}" eval apache22limits_enable="\${apache22limits_${profile}_enable:-${apache22limits_enable}}" eval apache22limits_args="\${apache22limits_${profile}_args:-${apache22limits_args}}" apache22_flags="-f ${apache22_configfile} -c \"PidFile ${pidfile}\" ${apache22_flags}" else echo "$0: extra argument ignored" fielse if [ "x${apache22_profiles}" != "x" -a "x$1" != "x" ]; then if [ "x$1" != "xrestart" ]; then for profile in ${apache22_profiles}; do echo "===> apache22 profile: ${profile}" /usr/local/etc/rc.d/apache22.sh $1 ${profile} retcode="$?" if [ "0${retcode}" -ne 0 ]; then failed="${profile} (${retcode}) ${failed:-}" else success="${profile} ${success:-}" fi done exit 0 else restart_precmd="" fi fifiif [ "${1}" != "stop" ] ; then \ apache22_accf || apache22_flags="${apache22_flags} -DNOHTTPACCEPT"fiapache22_requirepidfile(){ if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then echo "${name} not running? (check $pidfile)." exit 1 fi}apache22_checkconfig(){ echo "Performing sanity check on apache22 configuration:" eval ${command} ${apache22_flags} -t}apache22_graceful() { apache22_requirepidfile echo "Performing a graceful restart" eval ${command} ${apache22_flags} -k graceful}apache22_gracefulstop() { apache22_requirepidfile echo "Performing a graceful stop" eval ${command} ${apache22_flags} -k graceful-stop}apache22_precmd(){ apache22_checkconfig if test -f /usr/local/sbin/envvars then . /usr/local/sbin/envvars fi if checkyesno apache22limits_enable then eval `/usr/bin/limits ${apache22limits_args}` 2>/dev/null else return 0 fi}extra_commands="reload graceful gracefulstop configtest"run_rc_command "$1"guruдля запуска апача в /etc/rc.conf допиши apache22_enable="YES"и сделай /usr/local/etc/rc.d/apache22 start для запускаnewbee*DRINK* как все просто :)guruесли конфиг апача рабочий - должно стартонутьnewbeetools# //usr/local/etc/rc.d/apache22 startPerforming sanity check on apache22 configuration:httpd: apr_sockaddr_info_get() failed for tools.voliacable.comhttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNameSyntax OKStarting apache22.httpd: apr_sockaddr_info_get() failed for tools.voliacable.comhttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName guruв конфиге пропиши ченить в ServerName...но вообще сам апач помоему и так стартонул,проверь в процесах есть оно или нетnewbeeнетуguru.... да, и на всяк случай -пользуй /usr/local/etc/rc.d/apache22 restartдля перезапускаguruпоправь конфиг, ServerNameguruи пробуй еще разок стартонутьnewbeetools# /usr/local/etc/rc.d/apache22 startPerforming sanity check on apache22 configuration:Syntax OKStarting apache22.tools#в процессах не вижу на 80м порту никого нетуguruпжди, причем тут процессы и 80й портnewbeeпопытался эксплорером посмотреть на хост - пустоgurups -auxww |grep httpnewbeetools# ps -auxww|grep httproot 60642 0.0 0.0 372 252 p0 R+ 8:58AM 0:00.00 grep httpguruнаверно нет :-(netstat -an |grep LISTENnewbeetools# netstat -an|grep LISTENtcp4 0 0 127.0.0.1.25 *.* LISTENtcp4 0 0 *.22 *.* LISTENtcp6 0 0 *.22 *.* LISTENnewbeetools# /usr/local/etc/rc.d/apache22 statusapache22 is not running.guruдохлодавай логи читать /var/log/httpd-error.logguruпомоему есть догадкиnewbeetools# cat httpd-error.log[Tue Aug 28 08:50:48 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache][Tue Aug 28 08:50:48 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "xxx.xxx.com"Configuration Failed[Tue Aug 28 08:55:23 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache][Tue Aug 28 08:55:23 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "xxx.xxx.com"Configuration Failed[Tue Aug 28 08:56:47 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache][Tue Aug 28 08:56:47 2007] [alert] (EAI 8)hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "xxx.xxx.com"Configuration Failedguruдай мне свой /etc/hostsnewbeetools# cat /etc/hosts# $FreeBSD: src/etc/hosts,v 1.16 2003/01/28 21:29:23 dbaker Exp $## Host Database## This file should contain the addresses and aliases for local hosts that# share this file. Replace 'my.domain' below with the domainname of your# machine.## In the presence of the domain name service or NIS, this file may# not be consulted at all; see /etc/nsswitch.conf for the resolution order.##::1 localhost localhost.my.domain127.0.0.1 localhost localhost.my.domain## Imaginary network.#10.0.0.2 myname.my.domain myname#10.0.0.3 myfriend.my.domain myfriend## According to RFC 1918, you can use the following IP networks for# private nets which will never be connected to the Internet:## 10.0.0.0 - 10.255.255.255# 172.16.0.0 - 172.31.255.255# 192.168.0.0 - 192.168.255.255## In case you want to be able to connect to the Internet, you need# real official assigned numbers. Do not try to invent your own network# numbers but instead get one from your network provider (if any) or# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)guru127.0.0.1 localhost localhost.my.domainзамени на127.0.0.1 localhost xxx.xxx.comnewbee PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND60702 root 1 8 0 6416K 4864K nanslp 0:01 16.02% httpd*DRINK*newbeeIt works![:-}

Подписаться

RSS-материал