Errors like “page unreachable” or “Error 404” are most encountered problems on http server. This tutorial will take a case where index page can’t being reachable because of selinux settings.

We will create a new index file for our apache server which will be shown on our home page. First let’s check if apache is turned on.

My server “http” has as IP adress.

Yes it’s working.

Here you see the type of index.html file is “admin_home_t” which is not authorized under /var/www/html directory.

With this Selinux context your index page won’t be shown because linux apply security restrictions on this file.  You can check log files to see error messages. Selinux logs are kept by  /var/log/audit/audit.log

AVC tag (Access Vector Cache) here is selinux log message. You can see in first line we have a avc access denied error. This occured because wrong label for http service was applied for index.html file. We have to restore it. So, if you have some problems with apache, ftp servers, users and permissions you can think about selinux first. Most important here is security type label field, shown by yellow highlight, pay attention here and check differences between before and after restoring security type.

After restoring the type label refresh your browser. You will reach your index page.

And that’s all !