I have added below configuration to the httpd.conf and restarted the lampp service and it started working. Thanks to all the above posts, which helped me to resolve issues one by one.
Listen 8080<VirtualHost *:8080> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "/opt/lampp/docs/dummy-host2.example.com" ServerName localhost:8080 ErrorLog "logs/dummy-host2.example.com-error_log" CustomLog "logs/dummy-host2.example.com-access_log" common<Directory "/opt/lampp/docs/dummy-host2.example.com"> Require all granted </Directory></VirtualHost>