�������-��������� �������
Rambler's Top100

� �������������������� � ������������������ �������������
����������� ���������������� ����������������� ��������� �������������� ���������
���������� �����

���������� ��� �������������

��������� �������� � �������

��� ������� �� ��������. ��� ������?
������ ��� ������ ��� ������, ����������� ���������, ��� ��������� ���������:

  • ������� �������� �� ������ � ������ ASCII
  • Perl-������� ���������� ������� #!/usr/local/bin/perl
  • ����� ������� � ������� ����������� � 755 (u+rwx g+rx o+rx)
���� �� ������� �� �������� ���������� �������, � ������ �� �������� �� �������� (� �������, ����� ��������� �� ���������� �����-���� ������������ ����������), ��������� � ����� ������� ����������� ��������� [email protected].

��� ������� ���� �������� 404, 403, 500?
��� ���������� ������� � ����� ������ ����� ���� .htaccess, ������� ��������� ����������:

ErrorDocument 404 /not_found.html 
ErrorDocument 403 /forbidden.html 
ErrorDocument 500 /servererror.html

����� not_found.html, forbidden.html � servererror.html - ��� �������� ����� ������������ � ����� Public_html �������.

����� ����� ������������ ����� �������� �������� � ���������������� ������� � �������� ��������� �� �������.



����� ����� ��������: �������� ��� �� �����

���������� �����:
����� ���������� � ��������
���� ���������� ������ ��������, ������ �������������� ���������� ��: ������������ �������, ���-������, ����.
����� ���������� ��� ��������
������ �� ����� ���������� �������, ���������� �������� ������ �������� POP3, FTP � SSH, ������� ����� ������ ������� � ���������� �����, �������� �������� � ������ � �������� �����������������.
������������ �� ������� ����������
�������� �������, ������������� ������������ ������������ �������� ��������� Webalyzer.



����������������� ������� - �������� � ������������ �� ���������

��������� �����������
�� ����������� �������� �������� �����:

/public_html/cgistd/board.pl
�������� ����������� ���� �����������. �� ��� �������� � �� ������� ���������������� ��������������.

/public_html/cgistd/config.std
���������������� ����. �� �������� ���� � ������ �����������, ������� ��� ������� �������� ������ � ��� ������, ���� �� ������, � �������, ����������� ����������� � �����-���� ������ �����. ��� �� ��� ���������� ��������� $perpagedisplay (���������� ��������� �� ��������, �� ��������� - 30), � ��� �� $title (��������� �����������, �� ��������� ����� "Test conference"). ���� ���� ������ ���������� � ����� ����� � ������ board.pl.

/public_html/conf.shtml
����, �������������� ����� ���� �����������. � �� ���������� ������ ���� ���������, ������� �����-���� ���� ���������� � �����. �� ������ ��������� �� ���� ������ � �����-���� ��������, ������, ��� ��� ������ ���� �� ����������� ������ �����. ��� �� ��� ���������� � ����������� ������������� ���������� ��������� � ����� public_html ����� ����������� ����� multipage1.html .. multipageN.html, �������������� ����� �������� �����������. ���������� ��������� �� ������ �� ����� ������� ������������ ���������� $perpagedisplay �� ����� /public_html/cgistd/config.std

/public_html/head.inc
����-������, ���������� �������� ����� ���������� � ������ ������� ��������� ��� �� �������� �����������. �� ������ �������� ���� ���� �� ����. ������ ����� - ������� html.

/public_html/bottom.inc
����-������, ���������� �������� ����� ���������� � ����� ������� ��������� ��� �� �������� �����������. �� ������ �������� ���� ���� �� ����. ������ ����� - ������� html.

��������� �����������
���� ������� ������ ������, ����������� ��� ���������������� ������� ����������� � �� ����������:

/public_html/cgistd/vote.cgi
����������� ���� �����������. �� ��� �������� � �� ������� ���������������� ��������������.

/public_html/cgistd/vote.cfg
���������������� ���� �����������. � �� ���������� ��������� �����������, ������� �� ������ ��������. � �������, ��� ������� �������� ��������� �����:

����� ���� �� �������������?
  • �������
  • Ƹ����
  • ������
  • � ����������� ����������� ������
��� ����� ��� ������� ������� ���� /public_html/cgistd/vote.cfg � ������� ���� ���������:

ITEM1:����� ���� �� �������������?:�������:Ƹ����:������:� ����������� ����������� ������

����� ����� ��� ���� ��������� �������� �� ��� �������� ������ �����, ��� �� ���������� ��������� ������ �����, ��������� �����:

<form action="/cgistd/vote.cgi" method="post">
<input type=hidden name=filebase value="vote">
<input type=hidden name=action value="VOTE">
����� ���� �� �������������?<BR>
<input type="radio" name=ITEM1 value="0">�������
<input type="radio" name=ITEM1 value="1">Ƹ����
<input type="radio" name=ITEM1 value="2">������ <input type="radio" name=ITEM1 value="3">� ����������� ����������� ������
<input type=submit value="VOTE">
</form>

�������� ��������, ��� �� ������ ������������ ��������� ����� �� ���� � ����� �������. ��� ����� ��� ���� ���� ������� ��������������� ���������� ����� � ���� vote.cfg, ������ ��� ��������� ������� �����, �������� �� ITEM1, � �������� ��������������� ���� ����� ���� radio � ����� ��� �����������.

/public_html/vote.shtml
���� � �������� ����� ��� �����������

/public_html/head_vote.inc
����-������, ���������� �������� ����� ���������� � ������ c������� � ������������ �����������. �� ������ �������� ���� ���� �� ����. ������ ����� - ������� html.

/public_html/bottom_vote.inc
����-������, ���������� �������� ����� ���������� � ����� �������� � ������������ �����������. �� ������ �������� ���� ���� �� ����. ������ ����� - ������� html.

��������� ������� ������
�� ������������� ��� ����������� ������������ ��� ������ �� ������ ����� ��������� ������� MnogoSearch, ������� �������� ��������� �������� �������������� ����. ��� ��� ��������? ��� ���� � ������ ����� ��������� ������� ���������� ������� ��� ���� �� ������� � ������� ��� ��������� � ���� ������, �� ������� ����� � �������������� �����. ������������������ �������������� �� ������ � �������������.

��� ����, ����� �������� �� �����-���� �������� ����� ��� ������ �� �����, �������������� ��������� ������. ��� ���� ����� ����� �������� ����� �� ���� �������� ��������� �� ������� ����� ��������� ��������� (�� ����, ���� ��� ����� �� ftp - vasya_web, �� ��������� ����� �������� ����� vasya), � ��� �� ���������� ������ �����.������.�������.ru �������� ����� ������ ���-�����. �������� ��������, ��� ������������� ������ � ���������� ���� ����� �������� ul � q.

<FORM METHOD=GET ACTION="/cgistd/search_<yourlogin>.cgi">
<input type=hidden name="ul" value="http://�����.������.�������.ru/">

<table bgcolor=#eeeee0 order=1 width=100%>
<tr><td>
<BR>
������ ������: <INPUT TYPE="text" NAME="q" SIZE=50 VALUE="$Q">
<INPUT TYPE="submit" VALUE="Search!"><BR>

����������� �� ��������:
<SELECT NAME="ps">
<OPTION VALUE="10">10
<OPTION VALUE="20">20
<OPTION VALUE="50">50
</SELECT>

������ ������:
<SELECT NAME="o">
<OPTION VALUE="0">���������
<OPTION VALUE="1">�������
<OPTION VALUE="2">������ URL
</SELECT>

������� ������:
<SELECT NAME="m">
<OPTION VALUE="all">��� �����
<OPTION VALUE="any">����� �� ���
<OPTION VALUE="bool">����������
<OPTION VALUE="phrase">������ �����
</SELECT>

������
<SELECT NAME="wm">
<OPTION VALUE="wrd">����� �����
<OPTION VALUE="beg">������ �����
<OPTION VALUE="end">����� �����
<OPTION VALUE="sub">���������
</SELECT>

������ �
<SELECT NAME="wf">
<OPTION VALUE="222210">��� ���������
<OPTION VALUE="220000">��������
<OPTION VALUE="202000">�������� ������
<OPTION VALUE="200200">���������
<OPTION VALUE="200010">����������
</SELECT>
</td>
</tr>
</table>
</form>

/search.tmpl
����, ������� ����� �������������� ��������� �������� � �������� ������� ������. �� ������ �� ��������� ������, ������ ������� ����� ������������ html-���� � ��������� ����������� ����������������, �������� ������� ������� ����.

���� ������ ������������ ����� HTML-����, ���������� �� ������. ������ �� ������ �������������� ����� <!--��� ������--> � ������������� ����� <!--/��� ������-->. ����� ���� ������ ������������� �� ��������� �������.

������ ��������� ��� ������:
1. top
��� ������ ������������ �� ������ �������� ������, � ��������� � ������, ������� ������ ������ ���������� � <html> � ��� �����. ����� ������������ ��������� ���������� � �������� ������ ������:

$A - ���������� ��� �������� �� �������� form action, �.�. � ������ ����� �������� <form action=$a> ��� ��������� � �������� ����������� ����� ������.

$Q - c����� ������, ������� ����� ������������.

2. bottom
��� ������ ��������� ������ ����� ���� HTML-�������. �������� ��������, ��� ������ �����������, � ������ ��������� ��� ����������� ����, �������� � ���� �������.

3. restop
��� ������ ���������� � �������� � ����������� ������ ����� ����� ������� ����������� ������. � ������ ����������� ��������� ���������:

$f - ���������� ����� ������� ��������� �� ��������

$l - ���������� ����� ���������� ��������� �� ��������

$t - ����� ���������� ��������� ����������

$W - ���������� � ���������� ��������� ���� ��� ������ �� ���������� ������

4. res
������ ���������� ������� ������ �������� � ���������

$DU - URL ���������

$DT - ���������� ���� TITLE ���������

$DX - ��� ������ ������ ���������

$DC - ��� ��������� (text/html, image/gif, plain-text)

$DM - ���� ���������� ���������

$DS - ������ ���������

$DD - ���������� META DESCRIPTION

5. resbot
���������� � ��������� ����� ������ ��������� ����������.

$V - ������ �� ���������� � ����������� ��������.

5.1 navleft
$NH - ��� ���������� ��������

5.2 navbar0
����� ������� ��������

5.3 navright
$NH - ��� ��������� ��������

5.4 navbar1 - ������ ������� �� ��������

$NN - ����� �������� $HN - ������ �� ����������� �������� $HR - ������ �� ���������� ��������

6. notfound
������ ����� ���������, ���������� ��� ���������� �����������.

7. error
������ ����� �����, ���������� ������������ ��� ��������������� ������ ������ ������� (���������� �������)

8. � ������ ������� ������� ������ ����

<!--variables
DBHost          localhost
DBUser          username
DBPass          password
DBName          basename
LocalCharset    cp1251
-->
������� ����������� ������ �������������� � ���� �����. ��� ����� ��������� ��������� ��� ����������� ���������������� ������� ������, ������� �� ������� ��������, ����� ����� ���������� ��������� ��������.

��������� �������� �����
�������� �������� ����� ������� �� ��������� ������:

/public_html/cgistd/gb.pl
�������� ���� �������� �����. ��� ������ ��� ���������� ������� ������ �������� �������� ����� (�� ������ �������� - �� 10 ���������, ��������, ������� ���������� ����� ��������� �� �������� ���������� $perpage � ��������� � ������ ������� �����). ����� ���� ����������� ����� ������������ � ������ � �������� ����� � ������������� �, ��������� �� ��������������� �������� ������ ���� <a href="/cgistd/gb.pl">��� �������� �����</a>

/public_html/head_gbook.inc
����-������, ������� ����� ���������� � ������ ������ �������� �������� �����. ������ - ������� html

/public_html/bottom_gbook.inc
����-������, ������� ����� ���������� � ����� ������ �������� �������� �����. ������ - ������� html


�����������

��� ��� ��������� ���������/��������� ������ � ����� �� IP-�������?
��� ����, ����� ���������� ������ � ������ ����� �� IP-������� , �������� � ����� public_html ���� .htaccess � ������� ���� ��������� ������:

<Limit GET POST>
Allow from 192.168.1.
Allow from 10.0.0.2
Allow from .securedarea.com
Deny from 134.34.1.
Deny from 43.52.61.3
Deny from .evil.org
</Limit>
�������� ����������� ��������� ������ � ������ ����� ����� 192.168.1.0/24, ������ 10.0.0.2 � ������������� �� ������ securedarea.com � ��������� ������ �� ���� 134.34.1.0/24, ������ 43.52.61.3 � ���� ������������� �� ������ .evil.org.

��� ��� ������� ������� ���� �� ����� �����
��� ����� ��� ���������� ��������������� �������� �����������������. ����� � �� �� ������ � ������ �����, ����� � ����� �� ������ �������� ��� � ������� „��� ��������“ ���� ����� (��� ����� �������� ��� �����������) � ������ (������� �� ������ ���� �������� ������� ����� �������� ��������).

����� ����� � ������� �����������������, ��� ����� ����� � ������ „���� www-�������“. ����� ���� �������� ������� ���������� � ����� �������. ������� �� ������ „>“ � ������� „������“ ��� ����, ����� ������� � ��������� ������� �� �����.

����� ���� �������� ������ ������ ���� ����� — ������ ��������� ������ �����. ��� ����, ����� ������� ������ �����, �������� � � ������ (��������� ����� � ��� �������), ����� ����� ��������� ���� „���“, „������“ � ��� ��� ������� ������ � ���� „������ ��� ��������“. ������ ����� ���������� ����� ������� ������ „>“.

���������:

  • � ������ ����� ������� ��������� ����� �����.
  • ��� ������� ������ ����� ������� ������ ��������� �����, �� �� �������� ������ ����� ������������� � ��� ���� ��������� � �� �����.
  • ������� ����������������� ��� ��������� ������ ������ � ��������� ����� ���� .htaccess � ���������������� �����������. ���� � ���� ����� ��� ���� ���� .htaccess, �� �� ����� �����������, � ��������� �� ���� �� ����������.

    ���� ��������� ����� ���������, �� ����� ���������� ������ �������� ��������� ����� ����� .htaccess, � ����� ������ ���������� ��������� �� ���� ����� � ����� ����, ������� ����� ������ �������� ����������������� (��������������� ���� .htaccess ����� � ����� ��������� ���������).


���� ������

��� ������������� ���� ������ �� �������?
��� ����, ����� ������������� �� MySQL, ��� ���������� ������������ ������� mysql, ������� ����������� � ����������� mysql -u user -p basename, ��� user � basename - ��� ������������ � ���� ������, ���������� ��� ��� �����������. ����� ������������� �� Postgres, �� ������ ��������� psql.

��� ������� ������� � MySQL ��� Postgre?

CREATE TABLE tablename (columnname TYPE, ..);

������ ������� Postgres �� �����������, ������� ��� �� ������ �����-�� ������?
���������� ������� � ������� ���������:

[email protected]$ sh
$ set LD_LIBRARY_PATH=/usr/home/pgsql/lib; export LD_LIBRARY_PATH
� ����� ��������� psql. ���� ������ ����� �����������, �������� ���.

��� ��� �������������� ���� ����������, ���������� � ��?
���������� ��������� ���������� � �� ����� ��������� ������ — ��� ������� ����� ������������� �������.

��� ��� ������������ mysql � ���� perl-����������?

use Mysql;

��� ��� ������������ postgre � ���� perl-����������?

use Pg;


���� � ��� �������� �������:



© 2000-2001 Copyright. Maverick Agency. ��� ����� ��������. ������ ����� ������ � �������� ArtVision