logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Forbidden 403, zip downloadable file, Permissions!?

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
roob



Joined: 25 Apr 2019
Posts: 2
Location: united states

PostPosted: Thu 25 Apr '19 16:52    Post subject: Forbidden 403, zip downloadable file, Permissions!? Reply with quote

Here is the background! Please help I have been searching for days and I am about to chuck this computer through the window!! Mad
++++++++++++++++++++++
+Apache 2.4 + CentOS7+
++++++++++++++++++++++

2 websites via <VirtualHost.conf>

==========================================================
<VirtualHost *:80>
site1
</VirtualHost>


<VirtualHost *:80> (This website contains the zip file)
site2


<Directory "/var/www/html/site2"
<Files "Xx.zip">
***Some kinda of permissions?? IDK ***

</Files>
</Directory>

</VirtualHost>
===========================================================

The Xx.zip file is located in "/var/www/html/site2" along with the index.html file!!

ls -l Xx.Zip
$ -rwxr-xr-x root root 11182828 Apr 10 13:12 Xx.zip

What am I missing here?

When I access my site via browser its displays the website correctly, but when I click the download link....

<a href="Xx.zip">Download</a>

(what the link looks like in index.html)

I get a new page stating 403 do not have access to Xx.zip on this server.

Please enlighten me!! How do I make sure that when anyone clicks this Download link when visiting the site they will automatically start downloading the zip file!?
Back to top
roob



Joined: 25 Apr 2019
Posts: 2
Location: united states

PostPosted: Thu 25 Apr '19 19:47    Post subject: Reply with quote

Sooo, after doing some more research the reason this is happening is due to how I moved the file to the folder it resides in now...

Instead of $ mv command
I should use the $ cp command selinux context changes to where you are moving the file to, mv keeps selinux context where you moved it from....

I used

$ restorecon -r /var/www/html/site2/Xx.zip

This fixed this problem!
I hope this helps someone in the future!
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1