Score:1

Problem with apache2 on Ubuntu 18.04

id flag

It turns out that I am trying to see the contents of the folder but nothing comes out, I get this image. enter image description here

And this is my configuration of the file that is giving me an error

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    
    <Directory /var/www/html>

        DirectoryIndex red.html
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

    </Directory>
    
    <Directory /var/www/html/datos>

        DirectoryIndex index.html
                Options FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

    </Directory>
    
    Alias /wiki /home/alumno/wiki
    <Directory /home/alumno/wiki>

        DirectoryIndex index.html
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    
    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

    ErrorDocument 404 /no_encontrada.html
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

What gives me an error is the following part because it worked before

Alias /wiki /home/alumno/wiki
    <Directory /home/alumno/wiki>

        DirectoryIndex index.html
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    
    </Directory>

I have restarted the service and it restarts fine for me as we can see in the following image

enter image description here

It should come out like the following image

enter image description here

the permissions of the /home/student/wiki folder is:

enter image description here

I just looked at the error log and it says the following

enter image description here

[Sun Jan 30 20:43:23.441530 2022] [authz_core:error] [pid 6242:tid 139632557659904] [client 127.0.0.1:57776] AH01630: client denied by server configuration: /home/alumno/wiki

Thank you very much for your help

Tilman avatar
cn flag
What are the access permissions on the directory `/home/alumno/wiki`? You may display them with the command: `ls -ld /home/alumno/wiki`
in flag
This may be caused by AppArmor blocking access to `/home`. What policies do you have in place for Apache in AppArmor?
Javier G.Raya avatar
id flag
what is that about apparmor
Score:0
id flag

The problem was that you need to give it inside what this fails me.

Require all granted

I stay as follows:

Alias /wiki /home/alumno/wiki
    <Directory /home/alumno/wiki>

        DirectoryIndex index.html
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        Require all granted
    </Directory>

This is because it worked before in version 2.2 of apache but for 2.4 you have to add that last line

enter image description here

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.