Apache と PHP 及び PHP 関連パッケージをインストール。
~]# dnf -y install httpd php php-mbstring php-gd php-json php-xml php-zip
インストールされたモジュールの一覧を確認するなら。
~]# php -m
Apache 設定ファイル編集。
~]# vi /etc/httpd/conf/httpd.conf
変更と追加と削除。
ServerAdmin root@localhost ↓↓↓ ServerAdmin webmaster@wave440.com ・・・ ・・・ #ServerName www.example.com:80 ↓↓↓ ServerName www.wave440.com:80 ・・・ ・・・ <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.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks ↓↓↓ Options Includes ExecCGI FollowSymLinks # # 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 # # Controls who can get stuff from this server. # Require all granted </Directory> ・・・ ・・・ <IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined ↓↓↓ LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined ・・・ ・・・ # # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # SetEnvIf Request_URI "default\.ida" no_log SetEnvIf Request_URI "cmd\.exe" no_log SetEnvIf Request_URI "root\.exe" no_log SetEnvIf Request_URI "Admin\.dll" no_log SetEnvIf Request_URI "NULL\.IDA" no_log SetEnvIf Remote_Addr 127.0.0.1 no_log CustomLog "logs/access_log" combined env=!no_log </IfModule> ・・・ ・・・ #AddHandler cgi-script .cgi .pl ・・・ ・・・ # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # ErrorDocument 403 /error/403.shtml ErrorDocument 404 /error/404.shtml
以下を最終行へ追加。
ServerTokens Prod TraceEnable off
autoindex 設定ファイル編集。
~]# vi /etc/httpd/conf.d/autoindex.conf
削除。
<Directory "/usr/share/httpd/icons"> Options Indexes MultiViews FollowSymlinks AllowOverride None Require all granted </Directory>
テストページ削除。
~]# rm -f /etc/httpd/conf.d/welcome.conf
Perl コマンドへ /usr/local/bin/perl でもアクセスできるようにする。
~]# ln -s /usr/bin/perl /usr/local/bin/perl
Perl のパスを確認。
~]# whereis perl
Apache 自動起動有効+起動。
~]# systemctl enable --now httpd
ポート開放。
~]# firewall-cmd --add-service=http --zone=public --permanent ~]# firewall-cmd --reload