Установка Apache

Этот мануал адресован той категории пользователей, которые хотят установить Apache для локальной работы. Это в первую очередь нужно тем, кто пытается создать веб-страницу с использованием PHP или еще чего... Ведь написанные вами программы должен выполнять сервер. Когда я оказался в вашем положении - начал искать с запроса в Rambler'е. И нашел несколько... Все они оказались одним. Причем не очень хорошим. Это меня и подвигло на написание своего собственного рукописного Ивана Сусанина. Что-то долгое у меня получилось вступление. Сразу в пекло. В том самом мануале настойчиво рекомендуют "откусить" от своего винта мегабайт этак 100 и туда воткнуть Apache. Спорить не буду. Но я поставил его по умолчанию, и пока никаких проблем у меня не возникло. Вобщем, скачав дистрибутив Apache, ставим его в Program Files/Apache Group/Apache. При установке не имеет большого значения то, какие вы укажите значения. После успешной установки заходим в ../Apache. Ищем директорию conf. Там открываем в текстовом редакторе файл httpd.conf и превращаем его в подобие того, что вы видите ниже:


# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot "C:/Program Files/Apache Group/Apache"



# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin sergray2000@mail.ru


# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you 
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your 
# machine always knows itself by this address. If you use Apache strictly for 
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost


#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "D:/home/localhost/www"/

#
# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# permissions.  
#

    Options Indexes Includes
    AllowOverride All
    Allow from all


#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#


Options Indexes Includes 
AllowOverride All 
Allow from all 



#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index.  Separate multiple entries with spaces.
#

    DirectoryIndex index.html index.htm


    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "D:/home/localhost/cgi/"

    #
    # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #
    


# End of aliases.

    #
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    # For example, the PHP 3.x module (not part of the Apache distribution - see
    # http://www.php.net) will typically use:
    #
    #AddType application/x-httpd-php3 .php3
    #AddType application/x-httpd-php3-source .phps
    #
    # And for PHP 4.x, use:
    #
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
     
  AddType application/x-tar .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers",
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action command (see below)
    #
    # If you want to use server side includes, or CGI outside
    # ScriptAliased directories, uncomment the following lines.
    #
    # To use CGI scripts:
    #
    AddHandler cgi-script .cgi .bat .exe

    #
    # To use server-parsed HTML files
    #
    AddType text/html .shtml
    AddHandler server-parsed .shtml


# End of document types.


#
# End of proxy directives.
  
    Options ExecCGI
  
  ScriptAlias "/__php_dir__/" "C:/Program Files/PHP4/"
  Action application/x-httpd-php "/__php_dir__/php.exe"





После того как вы приведете свой файл httpd.conf к примерно такому виду ^ документы у вас должны будут находиться в папке home/localhost/www (php&html) на диске D:/. А доступ к вашему виртуальному серверу можно будет получить при запущенном Apache набрав в командной строке браузера http://localhost. Если у вас что-то не получается пишите нам. Мы обязательно вам поможем. Команда CompHelper{[SerGray]}.

© SerJik\SerGray
2002 _ Design by
SerGray & Co.

На главную
Hosted by uCoz