Вы находитесь на странице: 1из 14

: Apache 2.

x, PHP4, PERL
MySQL localhost Windows

c Apache, PHP,
Perl, MySQL.
, - -
, , .
,
Win32. web-
, ,
Apache 2.x,
PHP, Perl MySQL.

?
Apache: http://www.apache.org/
PHP: http://www.php.net/
MySQL: http://www.mysql.com/
ActivePerl: http://www.activestate.com/

Apache 2.x

, Apache:
1.3.x 2.x. 1.3.x
, 2.x .
,
1.3.x, 2.x .
2.x,
.


http://www.apache.org/. Windows
Win32/Binaries. .

. .
, :
e-mail, e-mail
. Network Domain
Server Name. ,
, , ,
localhost, hosts. hosts (
) Windows,
Win98 %SystemRoot%system32driversetc,
Win2k. ,
:
127.0.0.1 localhost __2 __3
__n

! Apache
,
() : for All Users on Port 80, as a
Service -- Recommended.
,
. web-,
Apache 1.3.,
: Only for the Current User, on Port 8080, whem started
Manually,
.
(->->Apache HTTP Server
2.0.40->Configure Apache Server-Start Apache in Console>).

.
Apache , .

80 , , 8080:

Listen 8080

, , ,
80, : http://:/, :
http://127.0.0.1:8080/

Typical.

Custom-
,
.
.
, .
, Apache !

Apache 2.x

.
C:Inet, .

,
httpd.conf:
->->Apache HTTP Server 2.0.40->Configure Apache
Server->Edit the Apache httpd.conf Configuration File.
,
httpd.conf conf ,
Apache, : C:Program FilesApache
GroupApache2conf
!
Apache.
httpd.default.conf,
,
,
httpd.conf.

1.3. Apache 2.x


: Global Environment ( ), Main server
configuration ( ) Virtual Hosts
( ).
.

.
:
DocumentRoot:
,
html- (
htdocs , ).
:

DocumentRoot "C:/Inet/localhost/www"

<Directory /> ... </Directory >.



.
htdocs .
,
DocumentRoot,
"C:/Inet/localhost/www"

<Directory "C:/Inet/localhost/www">
Options Indexes Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>



( Indexes), SSI (
Includes)
.htaccess ( All
AllowOverride).
:
Order allow,deny
Allow from all
.
,
( - allow,deny -
, ), (Allow from all) -
.

Indexes ,
- . ,
,
:

, ,
, 403 -
(
web-).
,
e-mail , On
ServerSignature EMail:

ServerSignature EMail
DirectoryIndex (,

, ):

DirectoryIndex index.html index.htm index.php

ErrorLog logs/error.log
CustomLog logs/access.log common


( ServerRoot),
- . ,
,
, :

ErrorLog C:/Inet/localhost/www/logs/error.log
CustomLog C:/Inet/localhost/www/logs/access.log common

logs,
.

Apache
:

Alias /manual "E:/usr/local/Apache2/manual"


<Directory "E:/usr/local/Apache2/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>

,
:
ScriptAlias ( ,
) :

ScriptAlias /cgi-bin/ "C:/Inet/localhost/cgi/"

<Directory ..> ... </Directory >


.
cgi- :

<Directory "C:/Inet/localhost/cgi/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

ExecCGI Options.

, Apache ,
AddDefaultCharset... (
) :

AddDefaultCharset WINDOWS-1251

:
#AddHandler cgi-script .cgi
:

AddHandler cgi-script .cgi .pl .exe .bat

Apache , .cgi .pl


.exe .bat CGI-.

SSI
:

#AddType text/html .shtml


#AddOutputFilter INCLUDES .shtml

SSI (Server-Side Include) - ,


.
, , ,
.
,
SSI:

AddType text/html .shtml .shtm .html .htm


AddOutputFilter INCLUDES .shtml . shtm .html .htm

, ,

.

,
, Apache !
:
http://127.0.0.1/manual/mod/directives.html
http://127.0.0.1:8080/manual/mod/directives.html

PHP

PHP http://www.php.net/
Win32 Binaries. .zip

, PHP,
C:PHP C:usrlocalphp. php.ini-
recommended php.ini Windows.
PHP.
php- php.ini .
php4ts.dll System System32.
. PHP
(
php.exe), Apache (
).
, ..
(
). PHP Apache
httpd.conf
:

LoadModule php4_module c:\php\sapi\php4apache2.dll


AddType application/x-httpd-php php php3 php4 phtml

(
), - ,
php-.
PHP.
1.3.x 2.x
(LoadModule).
php ,
php- .

PHP Apache
:

E:\>f:\Apache2\bin\apache.exe apache.exe: module


"c:\php4build\snap\sapi\apache2filter\sapi_apache2.c" is not
compatible with this version of Apache (found 20020628, need
20020903). Please contact the vendor for the correct version.

php4apache2.dll

.

Perl

ActivePerl
http://www.activestate.com/. C:usr.
web-.
,
Windows .cgi Perl.exe.
-
cgi,
, Perl.exe,
. ,
, ,
httpd.conf
:

ScriptInterpreterSource registry

MySQL

http://www.mysql.com/.
.
,
.
MySQLAdmin,
C:mysqlbinwinmysqladmin.exe
.

Apache 2.0.40, PHP 4.2.3, MySQL


3.23.52 Active Perl 5.8.0.802 WinXP.
Apache. , DocumentRoot,
HTML- index.html,
: http://127.0.0.1/ http://127.0.0.1:8080/ (
).
index.html.
SSI. , DocumentRoot,
HTML- test.shtml.
- <html> - :

<!--#set var="test" value=" SSI !" -->

( <body>) :

<!--#echo var="test" -->

: http://127.0.0.1/test.shtml,
SSI
!

PHP. C:Inetlocalhostwww
index.php :

<?
phpinfo();
?>

http://localhost/index.php.
,
PHP .

Perl. test.cgi
C:Inetlocalhostcgi:

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello world!<br>\n";

http://localhost/cgi-bin/test.cgi -
Hello World.

- , , .
,
!
!
raven

Вам также может понравиться