Welcome to the Linux Foundation Forum!

Lab 7.2 - Virtual host

Elyas Posts: 28
edited August 2017 in LFS211 Class Forum

When I execute the command

chcon -R --reference=$DOCUMENTROOT /ipvhost/

 then I get the error message

chcon: failed to get security context of ‘’: No such file or directory

Looks like SELinux to me. I checked the error log file and it says

[Wed Aug 09 07:59:36.145002 2017] [core:error] [pid 6343] (13)Permission denied: [client] AH00035: access to /index.html denied (filesystem path '/ipvhost/index.html') because search permissions are missing on a component of the path

Not knowing SELinux very well I would like to understand what solution I could apply.

I would not want to disable SELinux. I would like to understand what permission can be added to the component of the path so that my browser displays the index file of the virtual host.


  • lee42x
    lee42x Posts: 380
    edited August 2017

    In the "chcon -R --reference=$DOCUMENTROOT /ipvhost" command, we expected: 

    chcon -R --reference=/var/www/html  /ipvhost  

    The instructions in the chapter are supposed to clearly indicate that we need to subsitute our distro's location for the default apache document root into $DOCUMENTROOT.  Most of the current distro's are using "/var/www/html" as their default document root, but you may have to double check your primary apache config file to be sure. 

    The commad itself copies the SELinux context from the "--reference" location and applies it the target "/ipvhost" location. You can use "ls -Z / " and "ls -Z /var/wwwhtml " to see the contexts. 

    Thank you for bringing this to our attention, we will tidy up the instructions. 


Upcoming Training