0

I am working on a project build on spring boot. So now I am trying to access mp3 files deployed on apache webserver path /home/tomcat/webapps/example/WEB-INF/classes/static/public/example-content/Chapter-1/Audio/1.mp3. But I am getting 403 status saying forbidden error. I have configured my project for port 443 virtual host and given all permission to folders and files also.

Below is the virtual host configuration:

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    
    SSLEngine on
    SSLCertificateFile /home/cert/example/ssl.cer
    SSLCertificateKeyFile /home/cert/example/private.key
    SSLCertificateChainFile /home/cert/example/caclient.cer
    DocumentRoot /home/tomcat/webapps/example
    <Directory /home/tomcat/webapps/example/WEB-INF/classes/static/public/example-content/Chapter-1/Audio>
        Options -Indexes +FollowSymLinks +MultiViews
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ProxyRequests on
    ProxyPass / http://localhost:9111/example/
    ProxyPassReverse / http://localhost:9111/example/
    ProxyPassReverseCookiePath /example /
    ProxyPassReverseCookieDomain  example.com www.example.com
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
</VirtualHost>

But still getting same error each time. I don't know where I am doing mistake. If you have any suggestions or solutions, please provide me.

Screenshot of forbidden error

  • Does this answer your question? [Apache Tomcat:The requested resource () is not available (while acessing the resource that should be avaliable)](https://stackoverflow.com/questions/9516835/apache-tomcatthe-requested-resource-is-not-available-while-acessing-the-res) (and if it doesn't: You're not making your life easier by trying to work around the issue of unavailable WEB-INF content. As you proxy _everything_, e.g. starting at `/`, the `DocumentRoot` directive likely doesn't have any effect) – Olaf Kock Jun 20 '22 at 06:52
  • What are the O/S permissions on the file and the directories? Does the user running Tomcat have permission to read them? – stdunbar Jun 20 '22 at 19:43
  • Yes i have given 0777 full permission to whole project directory and the error comes from apache http server. –  Jun 21 '22 at 05:20

0 Answers0