Довольно внятный ман, сделанный с целью обозначить проблемку некоторых админов и прилепить к нему полную документяцию в pdf-формате.
# uname -sr
FreeBSD 8.1-PRERELEASE

# pkg_info | grep apache
apache-2.2.15_9

  • Предварительная подготовка

    Проверяем наличие или добавляем строки в /etc/make.conf:
    PORTSDIR?=/usr/ports

    .if ${.CURDIR} == ${PORTSDIR}/www/apache22
    SUEXEC_DOCROOT=/home
    SUEXEC_USERDIR=/home/*/cgi-bin
    .endif


  • Установка

    # cd /usr/ports/www/apache22
    # make install clean

    Конфигурация во время установки
    [X] THREADS Enable threads support in APR
    [ ] MYSQL Enable MySQL support for apr-dbd
    [ ] PGSQL Enable PostgreSQL support for apr-dbd
    [ ] SQLITE Enable SQLite support for apr-dbd
    [ ] IPV6 Enable IPv6 support
    [ ] BDB Enable BerkeleyDB dbm
    [ ] AUTH_BASIC Enable mod_auth_basic
    [ ] AUTH_DIGEST Enable mod_auth_digest
    [ ] AUTHN_FILE Enable mod_authn_file
    [ ] AUTHN_DBD Enable mod_authn_dbd
    [ ] AUTHN_DBM Enable mod_authn_dbm
    [ ] AUTHN_ANON Enable mod_authn_anon
    [ ] AUTHN_DEFAULT Enable mod_authn_default
    [ ] AUTHN_ALIAS Enable mod_authn_alias
    [X] AUTHZ_HOST Enable mod_authz_host
    [ ] AUTHZ_GROUPFILE Enable mod_authz_groupfile
    [ ] AUTHZ_USER Enable mod_authz_user
    [ ] AUTHZ_DBM Enable mod_authz_dbm
    [ ] AUTHZ_OWNER Enable mod_authz_owner
    [ ] AUTHZ_DEFAULT Enable mod_authz_default
    [ ] CACHE Enable mod_cache
    [ ] DISK_CACHE Enable mod_disk_cache
    [ ] FILE_CACHE Enable mod_file_cache
    [ ] MEM_CACHE Enable mod_mem_cache
    [ ] DAV Enable mod_dav
    [ ] DAV_FS Enable mod_dav_fs
    [ ] BUCKETEER Enable mod_bucketeer
    [ ] CASE_FILTER Enable mod_case_filter
    [ ] CASE_FILTER_IN Enable mod_case_filter_in
    [ ] EXT_FILTER Enable mod_ext_filter
    [ ] LOG_FORENSIC Enable mod_log_forensic
    [ ] OPTIONAL_HOOK_EXPORT Enable mod_optional_hook_export
    [ ] OPTIONAL_HOOK_IMPORT Enable mod_optional_hook_import
    [ ] OPTIONAL_FN_IMPORT Enable mod_optional_fn_import
    [ ] OPTIONAL_FN_EXPORT Enable mod_optional_fn_export
    [ ] LDAP Enable mod_ldap
    [ ] AUTHNZ_LDAP Enable mod_authnz_ldap
    [ ] ACTIONS Enable mod_actions
    [X] ALIAS Enable mod_alias
    [X] ASIS Enable mod_asis
    [ ] AUTOINDEX Enable mod_autoindex
    [ ] CERN_META Enable mod_cern_meta
    [X] CGI Enable mod_cgi
    [ ] CHARSET_LITE Enable mod_charset_lite
    [ ] DBD Enable mod_dbd
    [ ] DEFLATE Enable mod_deflate
    [X] DIR Enable mod_dir
    [ ] DUMPIO Enable mod_dumpio
    [X] ENV Enable mod_env
    [X] EXPIRES Enable mod_expires
    [X] HEADERS Enable mod_headers
    [ ] IMAGEMAP Enable mod_imagemap
    [X] INCLUDE Enable mod_include
    [X] INFO Enable mod_info
    [X] LOG_CONFIG Enable mod_log_config
    [X] LOGIO Enable mod_logio
    [X] MIME Enable mod_mime
    [X] MIME_MAGIC Enable mod_mime_magic
    [X] NEGOTIATION Enable mod_negotiation
    [ ] REWRITE Enable mod_rewrite
    [X] SETENVIF Enable mod_setenvif
    [X] SPELING Enable mod_speling
    [X] STATUS Enable mod_status
    [ ] UNIQUE_ID Enable mod_unique_id
    [ ] USERDIR Enable mod_userdir
    [ ] USERTRACK Enable mod_usertrack
    [X] VHOST_ALIAS Enable mod_vhost_alias
    [X] FILTER Enable mod_filter
    [X] VERSION Enable mod_version
    [ ] PROXY Enable mod_proxy
    [ ] PROXY_CONNECT Enable mod_proxy_connect
    [ ] PATCH_PROXY_CONNECT Patch proxy_connect SSL support
    [ ] PROXY_FTP Enable mod_proxy_ftp
    [ ] PROXY_HTTP Enable mod_proxy_http
    [ ] PROXY_AJP Enable mod_proxy_ajp
    [ ] PROXY_BALANCER Enable mod_proxy_balancer
    [ ] PROXY_SCGI Enable mod_proxy_scgi
    [X] SSL Enable mod_ssl
    [X] SUEXEC Enable mod_suexec
    [X] SUEXEC_RSRCLIMIT SuEXEC rlimits based on login class
    [X] REQTIMEOUT Enable mod_reqtimeout
    [ ] CGID Enable mod_cgid


  • Настройка

    Проверяем наличие или добавляем строку в /etc/rc.conf:
    apache22_enable="YES"

    Правим конфигурационный файл /usr/local/etc/apache22/httpd.conf
    ServerName localhost
    ServerRoot "/usr/local"
    Listen 80

    # Example:
    # LoadModule foo_module modules/mod_foo.so
    #
    LoadModule authz_host_module libexec/apache22/mod_authz_host.so
    LoadModule reqtimeout_module libexec/apache22/mod_reqtimeout.so
    LoadModule include_module libexec/apache22/mod_include.so
    LoadModule filter_module libexec/apache22/mod_filter.so
    LoadModule log_config_module libexec/apache22/mod_log_config.so
    LoadModule logio_module libexec/apache22/mod_logio.so
    LoadModule env_module libexec/apache22/mod_env.so
    LoadModule mime_magic_module libexec/apache22/mod_mime_magic.so
    LoadModule expires_module libexec/apache22/mod_expires.so
    LoadModule headers_module libexec/apache22/mod_headers.so
    LoadModule setenvif_module libexec/apache22/mod_setenvif.so
    LoadModule version_module libexec/apache22/mod_version.so
    LoadModule ssl_module libexec/apache22/mod_ssl.so
    LoadModule mime_module libexec/apache22/mod_mime.so
    LoadModule status_module libexec/apache22/mod_status.so
    LoadModule asis_module libexec/apache22/mod_asis.so
    LoadModule info_module libexec/apache22/mod_info.so
    LoadModule suexec_module libexec/apache22/mod_suexec.so
    LoadModule cgi_module libexec/apache22/mod_cgi.so
    LoadModule vhost_alias_module libexec/apache22/mod_vhost_alias.so
    LoadModule negotiation_module libexec/apache22/mod_negotiation.so
    LoadModule dir_module libexec/apache22/mod_dir.so
    LoadModule speling_module libexec/apache22/mod_speling.so
    LoadModule alias_module libexec/apache22/mod_alias.so

    <IfModule !mpm_netware_module>
    <IfModule !mpm_winnt_module>

    User www
    Group www
    </IfModule>
    </IfModule>

    # 'Main' server configuration
    #

    ServerAdmin you@example.com

    <Directory />
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>

    <IfModule dir_module>
    DirectoryIndex index.shtml

    </IfModule>

    <FilesMatch "^.ht">
    Order allow,deny
    Deny from all
    Satisfy All
    </FilesMatch>

    ErrorLog "/var/log/httpd-error.log"
    LogLevel warn

    <IfModule log_config_module>
    LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
    LogFormat "%h %l %u %t "%r" %>s %b" common

    <IfModule logio_module>

    LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
    </IfModule>
    </IfModule>

    DefaultType text/plain

    <IfModule mime_module>
    TypesConfig etc/apache22/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    </IfModule>

    # Virtual hosts - подробно о настройке нескольких сайтов для работы с разными юзерами
    Include etc/apache22/extra/httpd-vhosts.conf

    # Secure (SSL/TLS) connections
    #Include etc/apache22/extra/httpd-ssl.conf

    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    </IfModule>

    Include etc/apache22/Includes/*.conf

    Запускаем
    # /usr/local/etc/rc.d/apache22 start

    Проверяем что сервер запустился и работает
    ps ax | grep httpd
    77131 ?? Ss 0:00,21 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77134 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77135 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77136 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77137 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77138 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
    77149 ?? I 0:00,00 /usr/local/sbin/httpd -DNOHTTPACCEPT
  • Также опубликовано в:

    Написать комментарий

    вернуться к странице