https virtual host shown directory rather than html file

Posted on

i configure two virtual host in my http server ,and keep html file on /web/lab1/web1.html and /web/lab1/web2.html .

my problem is : when i search with my webpsite(https://web1.example.local and https://web2.example.local) then it shows lab1 and lab2 directory.
here it is: -

Index of /
[ICO] Name Last modified Size Description
[DIR] lab1/ 2020-09-11 22:30 -
[DIR] lab2/ 2020-09-11 22:31 -

here is my configuration files: -

httpd.conf

erverRoot "/etc/httpd"

Listen 80

Include conf.modules.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

AllowOverride none
Require all denied

DocumentRoot "/web"

AllowOverride None
Require all granted

Options Indexes FollowSymLinks

AllowOverride None

Require all granted

DirectoryIndex index.html

Require all denied

ErrorLog "logs/error_log"

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>


CustomLog "logs/access_log" combined

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

AllowOverride None
Options None
Require all granted

TypesConfig /etc/mime.types

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz



AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

AddDefaultCharset UTF-8

MIMEMagicFile conf/magic

EnableSendfile on

IncludeOptional conf.d/*.conf

ssl.conf

Listen 443 https

SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog

SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300

SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin

SSLCryptoDevice builtin

ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

SSLEngine on

SSLProtocol all -SSLv2 -SSLv3
SSLProtocol all +TLSv1 +TLSv1.1 +TLSv1.2

SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA

SSLCertificateFile /etc/pki/tls/certs/ssl-crt.crt

SSLCertificateKeyFile /etc/pki/tls/private/ssl-key.key

SSLOptions +StdEnvVars

SSLOptions +StdEnvVars

BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

web1.conf

ServerAdmin root@server.example.local
DocumentRoot "/web/lab1"
ServerName web1.example.local
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ssl-crt.crt
SSLCertificateKeyFile /etc/pki/tls/private/ssl-key.key
ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common

AllowOverride None
# Allow open access:
Require all granted

web2.conf

ServerAdmin root@server.example.local
DocumentRoot "/web/lab2/"
ServerName web2.example.local
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ssl-crt.crt
SSLCertificateKeyFile /etc/pki/tls/private/ssl-key.key
ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
CustomLog "/var/log/httpd/dummy-host.example.com-access_log" common

AllowOverride None
# Allow open access:
Require all granted

and also ,without ssl .. it shows two(web1.html and web2.html) html file. please,solve my problem.. how can i see my webpages by typing this two address ?