First check for the permission given for /var/www folder. Give apache:apache
as owner for /var/www/
.
Use the below command to install libreoffice headless package if it is not installed.
sudo yum install openoffice.org-headless
This has worked for me in centOS.