How to enable directory listing on apache web server

I cannot include the list of directories on my apache web server. I tried to post various solutions, but not working. I just installed httpd 2.4.6 and enabled https using ssl.conf in /etc/httpd/conf.d/ssl.conf dir and trying to access https://server.example.com/ , but this is not a list dir. This is the config in ssl.conf

DocumentRoot "/home/userx/Downloads/"
ServerName server.example.com:443

Below is what is available in ssl.conf under the VirtualHost element. The files and the first elements of the directory were already there when I installed, I just added the directory to "/ home / userx / Downloads". I want to view the contents of / home / userx / Downloads when accessing the URL https://server.example.com/ . What am I missing here?

<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
<Directory "/home/userx/Downloads">
  Options +Indexes
  AllowOverride all
</Directory>
+20
8

, / "/icons/". Apache.

: config httpd.conf. URL: IP: // , . , / '' var/www/icons '.

Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Require all granted
</Directory>

, '.

+18

.

<Directory "/home/userx/Downloads">
  Options +Indexes
  AllowOverride all
  Order allow,deny 
  Allow from all 
  Require all granted
</Directory>

, , , " " -, .

+4

, mod_autoindex Apache. .

sudo a2enmod autoindex
+4

Apache , DirectoryIndex .conf ( /etc/apache2/sites-available linux).

, :

DirectoryIndex , mod_autoindex . Options. , , :

<Directory /usr/local/apache2/htdocs/listme>   
  Options +Indexes
</Directory> 

(, ) Indexes Options . , :

<Directory /usr/local/apache2/htdocs/dontlistme>
  Options -Indexes
</Directory>
+4

SELinux:

chcon -R -t httpd_sys_content_t /home/*
+1

Options -Index Options +Index , .

$ sudo rm -f /etc/httpd/conf.d/welcome.conf
$ sudo service httpd restart

.

+1

, /var/www/html/.

sudo ln -s /home/ /var/www/html/

.

0

selinux, . . , selinux .

0

Source: https://habr.com/ru/post/1653072/


All Articles