###前提・実現したいこと
linux初心者です。
WEBサーバを構築しようとしていますがうまくいきません。
DocumentRootである/var/www/html/内の
test.htmlを表示しようとすると
ローカルにてアクセス:http://cent.tnet.jp/test.html
Not Found
The requested URL /test.html was not found on this server.
と表示されます。
###発生している問題・エラーメッセージ
エラーログ(/var/log/httpd/error_log)を確認すると
AH00128: File does not exist: /var/www/html/test.html
とありました。
下記に現在の設定ファイルを載せます。
色々試したので多少おかしくなっているかもしれません。
###httpd.conf
httpd.conf
1ServerRoot "/etc/httpd" 2Listen 80 3 4Include conf.modules.d/*.conf 5User apache 6 7Group apache 8ServerAdmin root@localhost 9ServerName cent.tnet.jp:80 10 11DocumentRoot "/var/www/html" 12 13<Directory /> 14 Options FollowSymLinks 15 AllowOverride none 16</Directory> 17 18<Directory "/var/www"> 19 AllowOverride None 20 Require all granted 21</Directory> 22 23<Directory "/var/www/html"> 24 Options ExecCGI FollowSymLinks 25 AllowOverride All 26 Require all granted 27</Directory> 28 29DirectoryIndex index.html 30 31<Files ".ht*"> 32 Require all denied 33</Files> 34 35ErrorLog "logs/error_log" 36 37LogLevel debug 38 39 40<IfModule log_config_module> 41 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 42 LogFormat "%h %l %u %t \"%r\" %>s %b" common 43 44 <IfModule logio_module> 45 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 46 </IfModule> 47 48 CustomLog "logs/access_log" combined 49</IfModule> 50 51<IfModule alias_module> 52 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 53</IfModule> 54 55<Directory "/var/www/cgi-bin"> 56 AllowOverride None 57 Options None 58 Require all granted 59</Directory> 60 61<IfModule mime_module> 62 TypesConfig /etc/mime.types 63 AddType application/x-compress .Z 64 AddType application/x-gzip .gz .tgz 65 66 AddHandler cgi-script .cgi .py .pl 67 68 AddType text/html .shtml 69 AddOutputFilter INCLUDES .shtml 70</IfModule> 71 72AddDefaultCharset UTF-8 73 74<IfModule mime_magic_module> 75 MIMEMagicFile conf/magic 76</IfModule> 77 78EnableSendfile on 79 80IncludeOptional conf.d/*.conf
###試したこと
下記コマンドを試しました。
setenforce 0
firewall-cmd --add-service=http --permanent (結果:success)
firewall-cmd --reload (結果:success)
systemctl restart httpd
サーバーに/var/www/html/test.htmlが存在することを確認しました。
サーバーに別名のファイル/var/www/html/index.htmlにて再度アクセスできないことを確認しました。
サーバーの別ファイル/var/www/cgi-bin/index.phpにてアクセスできないことを確認しました。
###補足情報(言語/FW/ツール等のバージョンなど)
OS:centos7
apache Version 2.4.6
一緒に入れたphpMyAdminは正常に表示されました。
情報が足りなければ捕捉します。
よろしくおねがいします。
回答1件
あなたの回答
tips
プレビュー