WebソスTソス[ソスoソス[ソス\ソスz(Apache)

ソスナ終ソスXソスVソスソスソスF 2023.02.23

ソスソスソスTソスv

WebソスTソス[ソスoソス[ソスソスChromeソスソスソスソスWebソスuソスソスソスEソスUソスソスソスソスWebソスyソス[ソスWソスソスソスンゑソスソス謔、ソスノゑソスソス驍スソス゚のサソス[ソスoソス[ソスB
ソスソスソスソスソスナは、WebソスTソス[ソスoソス[ソス\ソスtソスgソスニゑソスソストゑソスソスソスソスニゑソスソスgソスpソスソスソスソストゑソスソスソスApacheソスソスソスgソスpソスソスソスソスWebソスTソス[ソスoソス[ソスソスソス\ソスzソスソスソスAソスzソス[ソスソスソスyソス[ソスWソスXソスyソス[ソスXソス供サソス[ソスrソスXソスソスソスsソスソスソストゑソスソスソスソスハ的ソスソスWebソスTソス[ソスoソス[ソスニ難ソスソスlソスノ以会ソスソスフゑソスソスニゑソスソスナゑソスソスソス謔、ソスノゑソスソスソスB

  • CGIソスヘ任ソスモのデソスBソスソスソスNソスgソスソスソスナ趣ソスソスsソスナゑソスソスソス謔、ソスノゑソスソスソス
  • SSIソスヘ拡ソスソスソスqソスソスshtmlソスフ場合ソスフみ趣ソスソスsソスナゑソスソスソス謔、ソスノゑソスソスソス
  • .htaccessソスソスソスgソスpソスナゑソスソスソス謔、ソスノゑソスソスソス
  • PHPソスソスソスgソスpソスナゑソスソスソス謔、ソスノゑソスソスソス


ソスソスApacheソスCソスソスソスXソスgソス[ソスソス

[root@centos ~]# yum -y install httpd php php-mbstringソス@ソスソスソス@httpdソスAphpソスAphp-mbstringソスCソスソスソスXソスgソス[ソスソス

ソスソスApacheソスン抵ソス

ソスiソスPソスjApacheソスン抵ソス
[root@centos ~]# vi /etc/httpd/conf/httpd.confソス@ソスソスソス@Apacheソスン抵ソスtソス@ソスCソスソスソスメ集
#ServerName www.example.com:80
ソスソス
ServerName centossrv.com:80ソス@ソスソスソス@ソスTソス[ソスoソス[ソスソスソスソスソスwソスソス

<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks
ソス@ソス@ソスソス
    Options Includes ExecCGI FollowSymLinksソス@ソスソスソス@CGI,SSIソスフ具ソスソスソス

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None
ソス@ソス@ソスソス
    AllowOverride Allソス@ソスソスソス@.htaccessソスフ具ソスソスソス

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" commbinedソス@ソスソスソス@ソスソスソスソスソスソスソスソスURI(414ソスGソスソスソス[)ソスヘソスソスOソスノ記ソス^ソスソスソスネゑソス

#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
SetEnvIf Request_URI "default\.ida" no_logソス@ソスソスソス@ソスヌ会ソス(wormソスソスソスソスフアソスNソスZソスXソスソスソスソスソスOソスノ記ソス^ソスソスソスネゑソス)
SetEnvIf Request_URI "cmd\.exe" no_logソス@ソスソスソス@ソスV
SetEnvIf Request_URI "root\.exe" no_logソス@ソスソスソス@ソスV
SetEnvIf Request_URI "Admin\.dll" no_logソス@ソスソスソス@ソスV
SetEnvIf Request_URI "NULL\.IDA" no_logソス@ソスソスソス@ソスV
SetEnvIf Remote_Addr 192.168.1 no_logソス@ソスソスソス@ソスヌ会ソス(ソスソスソスソスソスソスソスソスフアソスNソスZソスXソスソスソスソスソスOソスノ記ソス^ソスソスソスネゑソス)
SetEnvIf Remote_Addr 127.0.0.1 no_logソス@ソスソスソス@ソスヌ会ソス(ソスソスソスzソスXソスgソスソスソスソスフアソスNソスZソスXソスソスソスソスソスOソスノ記ソス^ソスソスソスネゑソス)
CustomLog logs/access_log combined env=!no_logソス@ソスソスソス@ソスソスLソスネ外ソスフアソスNソスZソスXソスソスソスソスソスOソスノ記ソス^ソスソスソスソス

AddDefaultCharset UTF-8
ソスソス
#AddDefaultCharset UTF-8ソス@ソスソスソス@ソスRソスソスソスソスソスgソスAソスEソスg(ソスソスソスソスソスソスソスソスソスホ会ソス)

#AddHandler cgi-script .cgi
ソスソス
AddHandler cgi-script .cgi .plソス@ソスソスソス@CGIソスXソスNソスソスソスvソスgソスソス.plソスソスヌ会ソス

ソスネ会ソスソスソスソスナ終ソスsソスノ追会ソス
TraceEnable offソス@ソスソスソス@Traceソスソスソス\ソスbソスhソス無鯉ソスソスソスソスiソスNソスソスソスXソスTソスCソスgソスgソスソスソス[ソスVソスソスソスOソスホ搾ソスj

[root@centos ~]# vi /etc/httpd/conf.d/autoindex.confソス@ソスソスソス@autoindexソスン抵ソスtソス@ソスCソスソスソスメ集
<Directory "/usr/share/httpd/icons">
    Options MultiViewsソス@ソスソスソス@iconsソスfソスBソスソスソスNソスgソスソスソスフフソス@ソスCソスソスソス齬暦ソスソス\ソスソスソスソスソスネゑソスソス謔、ソスノゑソスソスソス
    AllowOverride None
    Require all granted
</Directory>

[root@centos ~]# rm -f /etc/httpd/conf.d/welcome.confソス@ソスソスソス@ソスeソスXソスgソスyソス[ソスWソス除

[root@centos ~]# rm -f /var/www/error/noindex.htmlソス@ソスソスソス@ソスeソスXソスgソスyソス[ソスWソス除

ソスiソスQソスjPerlソスRソス}ソスソスソスhソスソス/usr/local/bin/perlソスナゑソスソスAソスNソスZソスXソスナゑソスソスソス謔、ソスノゑソスソスソスB
[root@centos ~]# ln -s /usr/bin/perl /usr/local/bin/perlソス@ソスソスソス@/usr/local/bin/perlソスソスソスソス/usr/bin/perlソスヨソスソスソスソスNソスソスソスヘゑソス

[root@centos ~]# whereis perlソス@ソスソスソス@PerlソスフパソスXソスソスソスmソスF
perl: /usr/bin/perl /usr/local/bin/perl /usr/share/man/man1/perl.1.gzソス@ソスソスソス@PerlソスフパソスXソスソス/usr/local/bin/perlソスソスソス\ソスソスソスソスソスソス驍アソスニゑソスソスmソスF

ソスiソスRソスjソスhソスLソスソスソスソスソスソスソスgソスソスソス[ソスgソスソスソスLソスメ変更
ソスhソスLソスソスソスソスソスソスソスgソスソスソス[ソスgソスソスソスLソスメゑソスWebソスRソスソスソスeソスソスソスcソスメ集ソスソスソス[ソスUソス[ソスノ変更ソスソスソスソスB
[root@centos ~]# chown centos. /var/www/html/ソス@ソスソスソス@ソスhソスLソスソスソスソスソスソスソスgソスソスソス[ソスgソスソスソスLソスメゑソスマ更(centosソスヘ暦ソス)

[root@centos ~]# ll /var/www/ソス@ソスソスソス@ソスhソスLソスソスソスソスソスソスソスgソスソスソス[ソスgソスソスソスLソスメ変更ソスmソスF
ソスソスソスv 24
drwxr-xr-x  2 root      root      4096 10ソスソス  5 11:45 cgi-bin
drwxr-xr-x  3 root      root      4096 10ソスソス  9 00:19 error
drwxr-xr-x  5 centos    centos    4096  9ソスソス 27 17:43 html
drwxr-xr-x  3 root      root      4096  9ソスソス 27 09:29 icons

ソスソスApacheソスNソスソス

ソスiソスPソスjApacheソスNソスソス
[root@centos ~]# systemctl start httpdソス@ソスソスソス@ApacheソスNソスソス

[root@centos ~]# systemctl enable httpdソス@ソスソスソス@ApacheソスソスソスソスソスNソスソスソスン抵ソス

ソスiソスQソスjTCP80ソスヤポソス[ソスgソスJソスソス
ソスyソスソスソス[ソス^ソス[ソスz
ソスソスソス[ソス^ソス[ソスソスソスフ設抵ソスナ、TCP80ソスヤポソス[ソスgソスヨのアソスNソスZソスXソスソスソスTソス[ソスoソス[ソスノ転ソスソスソスソスソスソス謔、ソスノゑソスソスソスB
ソスソスソスソスソス[ソス^ソス[ソスフ設抵ソスヘ各ソスソスソス[ソス^ソス[ソスフマソスjソスソスソスAソスソスソスワゑソスソスソスソスソスソス[ソスJソス[ソスハソスソス[ソス^ソス[ソス|ソス[ソスgソスJソスソスソス闖ソスソスソスQソスソス

ソスyソスtソス@ソスCソスAソスEソスHソス[ソスソスソスzソスソスソスtソス@ソスCソスAソスEソスHソス[ソスソスソスソスソスソスソスソスソストゑソスソスソス鼾ソスフゑソス
ソスTソス[ソスoソス[ソスソスソスフフソス@ソスCソスAソスEソスHソス[ソスソスソスン抵ソスナ、TCP80ソスヤポソス[ソスgソスヨのアソスNソスZソスXソスソスソスソスソスツゑソスソスソス謔、ソスノゑソスソスソスB
ソスソスソスtソス@ソスCソスAソスEソスHソス[ソスソスソスン抵ソスヘゑソスソスソスソスソスソスソスQソスソス

Portソス`ソスFソスbソスNソスeソスXソスgソスyソスOソスソスソスソスソスソスソスPortソスJソスソスソスmソスFソスzソスナ「ソスzソスXソスgソスソス(FQDN) ソスワゑソスソスソス ソスOソスソスソス[ソスoソスソスIPソスAソスhソスソスソスXソスvソスノサソス[ソスoソス[ソスソス(ソスソス:centossrv.com)ソスAソスuソス`ソスFソスbソスNソス|ソス[ソスgソスヤ搾ソスソスvソスソス80ソスニ難ソスソスヘ、ソスuソスソスソスソスソスモ・ソスソスソス事搾ソスソスvソスソスソスmソスFソス`ソスFソスbソスNソスソスソスト「Portソス`ソスFソスbソスNソスソスソスsソスvソス{ソス^ソスソスソスソスソスソスソスソスソスソスソスA
ソスzソスXソスg:centossrv.com
ソス|ソス[ソスg:80
ソスノアソスNソスZソスXソスナゑソスソスワゑソスソスソス
ソスニ表ソスソスソスソスソスソス驍アソスニゑソスソスmソスFソスB

ソスiソスRソスjソスOソスソスソスソスソスソスソスWebソスTソス[ソスoソス[ソスAソスNソスZソスXソスmソスF
ソスOソスソスソスソスソスソスWebソスTソス[ソスoソス[ソスノアソスNソスZソスXソスナゑソスソス驍ゥソスmソスFソスソスソスソスB
[root@centos ~]# echo test >> /var/www/html/index.htmlソス@ソスソスソス@ソスeソスXソスgソスyソス[ソスWソス成

Website Testソスナ「Enter URLソスvソスソスソスノドソスソスソスCソスソスソスソス(ソスソス:http://centossrv.com)ソスソスソスソスヘゑソスソスト「Test Nowソスvソス{ソス^ソスソスソスソスソスソスソスソスソスソスソスソスB

ソスネ会ソスソスフようソスネ鯉ソスソスハゑソスソス\ソスソスソスソスソスソスソスソスOK
Results
for http://centossrv.com

URL tested http://centossrv.com
Website Test performed from New York, NY on 2021-01-03 02:18:28 (GMT +00:00)

Status	OKソス@ソスソスソス@OKソスソスソスmソスF
Resolved as	122.103.187.89
Response Time	0.863 seconds
DNS	0.174 s
Connect	0.170 s
Redirect	0.000 s
First Byte	0.255 s
Last Byte	0.263 s
Size	31840 bytes

[root@centos ~]# rm -f /var/www/html/index.htmlソス@ソスソスソス@ソスeソスXソスgソスyソス[ソスWソス除


ソスソスApacheソスmソスF

ソスiソスPソスjWebソスyソス[ソスWソス\ソスソスソスmソスF
[root@centos ~]# vi /var/www/html/index.htmlソス@ソスソスソス@ソスeソスXソスgソスyソス[ソスWソス成
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスUTF-8ソスフ場合
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスEUCソスフ場合
<title>ソスeソスXソスg</title>
</head>
<body>
ソスeソスXソスg
</body>
</html>
http://ソスTソス[ソスoソス[ソスソス/ソスノアソスNソスZソスXソスソスソストテソスXソスgソスyソス[ソスWソスソスソス\ソスソスソスソスソスソスソスソスOK

ソスiソスQソスjCGIソスmソスF
CGIソスナ簡単ソスネテソスXソスgソスyソス[ソスWソスソス\ソスソスソスソスソストみゑソスB
[root@centos ~]# vi /var/www/html/test.cgiソス@ソスソスソス@ソスeソスXソスgソスpCGIソス成
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスUTF-8ソスフ場合
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=euc-jp\">\n";ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスEUCソスフ場合
print "<title>ソスeソスXソスg</title>\n";
print "</head>\n";
print "<body>\n";
print "CGIソスeソスXソスg\n";
print "</body>\n";
print "</html>\n";

[root@centos ~]# chmod 755 /var/www/html/test.cgiソス@ソスソスソス@ソスeソスXソスgソスpCGIソスpソス[ソス~ソスbソスVソスソスソスソスソスマ更
http://ソスTソス[ソスoソス[ソスソス/test.cgiソスノアソスNソスZソスXソスソスソスソスCGIソスeソスXソスgソスyソス[ソスWソスソスソス\ソスソスソスソスソスソスソスソスOK

ソスiソスRソスjSSIソスmソスF
SSIソスナ鯉ソスソスン難ソスソスソスソスソス\ソスソスソスソスソストみゑソスB
[root@centos ~]# vi /var/www/html/test.shtmlソス@ソスソスソス@SSIソスeソスXソスgソスpソスyソス[ソスWソス成
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスUTF-8ソスフ場合
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスEUCソスフ場合
<title>ソスeソスXソスg</title>
</head>
<body>
SSIソスeソスXソスg
<!--#config timefmt="%Y/%m/%d %H:%M:%S" -->
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
http://ソスTソス[ソスoソス[ソスソス/test.shtmlソスノアソスNソスZソスXソスソスソスト鯉ソスソスン難ソスソスソスソスソス\ソスソスソスソスソスソスSSIソスeソスXソスgソスyソス[ソスWソスソスソス\ソスソスソスソスソスソスソスソスOK

ソスiソスSソスj.htaccessソスmソスF
.htaccessソスソスDirectoryIndex(ソスtソス@ソスCソスソスソスソスソスソスソスネ暦ソスソスソスソスソスソス鼾ソスノ表ソスソスソスソスソスソスソスyソス[ソスW)ソスソスindex.htmlソスソスソスソスindex.shtmlソスノ変更ソスソスソストみゑソスB
[root@centos ~]# vi /var/www/html/.htaccessソス@ソスソスソス@.htaccessソスtソス@ソスCソスソスソス成
DirectoryIndex index.shtml

[root@centos ~]# vi /var/www/html/index.shtmlソス@ソスソスソス@.htaccessソスeソスXソスgソスpソスyソス[ソスWソス成
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスUTF-8ソスフ場合
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">ソスソスソスVソスXソスeソスソスソスフ包ソスソスソスソスRソス[ソスhソスソスEUCソスフ場合
<title>ソスeソスXソスg</title>
</head>
<body>
<p>.htaccessソスノゑソスソスWebソスTソス[ソスoソス[ソスン抵ソス(ソスソスニゑソスソスソスDirectoryIndex)ソスフ変更ソスeソスXソスg</p>
ソスソスソスフペソス[ソスWソスフフソス@ソスCソスソスソスソスソスソス<!--#echo var="DOCUMENT_NAME" -->
</body>
</html>
http://ソスTソス[ソスoソス[ソスソス/ソスノアソスNソスZソスXソスソスソスソスindex.shtmlソスソスソス\ソスソスソスソスソスソスソスソスOK

ソスiソスTソスjPHPソスmソスF
PHPソスナ簡単ソスネテソスXソスgソスyソス[ソスWソスソス\ソスソスソスソスソストみゑソスB
[root@centos ~]# vi /var/www/html/test.phpソス@ソスソスソス@PHPソスeソスXソスgソスpソスyソス[ソスWソス成
<?php
  phpinfo();
?>
http://ソスTソス[ソスoソス[ソスソス/test.phpソスノアソスNソスZソスXソスソスソスソスphpinfoソスyソス[ソスWソスソスソス\ソスソスソスソスソスソスソスソスOK

ソスiソスUソスjWebソスTソス[ソスoソス[ソスmソスFソスソスnソスソス
ソスソスLソスフ確ソスFソスナ作成ソスソスソスソスソスeソスXソスgソスpソスyソス[ソスWソスソスソスソスSソスト削除ソスソスソスソスB
[root@centos ~]# rm -f /var/www/html/*ソス@ソスソスソス@ソス成ソスソスソスソスソスeソスXソスgソスpソスyソス[ソスWソスソスSソスト削除

[root@centos ~]# rm -f /var/www/html/.htaccessソス@ソスソスソス@ソス成ソスソスソスソス.htaccessソスソスソス除


ソスソスソスヨ連ソスRソスソスソスeソスソスソスc

<!ソス\ソスeソスLソスXソスgソスフみゑソス4ソスsソス\ソスソスソスノ追会ソスソスソスCソスソスソスソスソスソス\>



ソスソスソスソスソスフペソス[ソスWソスフトソスbソスvソスヨ戻ゑソス

ソスvソスソスソスCソスoソスVソス[ソス|ソスソスソスVソス[
centossrv.com