I've been stumped with this for a couple days now. I set up apache on my VPS and am uploading files frequently via FTP to my website. However, when I try to access those links in the browser, Apache gives me a 403 error. When I run the command "chmod 755" on the file and refresh, however, the file is accessed fine. I had the same error when I tried using nginx as my software. Thanks!
I had the same problem. Running command "chmod 755" solved problem but if user upload new file you need to run command again and again...
So I set the default permission for newly uploaded files in /etc/vsftpd.conf
file_open_mode=0755
local_umask=022
Related
I have made a custom folder within WordPress' uploads directory to house some downloadable files, however I don't want these to be directly accessible, they should only be accessible via a script for example.
To accomplish this I simply put a .htaccess file in the respective folder containing:
Deny from all
My development environment is Windows and this was working fine, both the folder and file returned a 403 Forbidden and I was able to force download the file via a script.
Now I have uploaded the site to a staging server that is running on Linux (RedHat I think?), Apache as well, but for both the folder and the file it returns a 404 Not Found and hence the file download also fails.
What am I missing here? Why is it acting differently? Should I be putting some different/extra in the .htaccess file?
Edit: I just noticed that whilst it IS stating it is a 404, it is redirecting to a 403.shtml file.
I'm moving this website http://farmtrust.tn built using PrestaShop in a new Hosting provider. This is the new URL http://shop.farmtruster.com. And now when I try to access the admin back-end I get a FatalErrorException.
FatalErrorException
Compile Error: Symfony\Component\Debug\DebugClassLoader::loadClass(): Failed opening required '/var/www/html/vendor/composer/../symfony/symfony/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfTokenClearingLogoutHandlerPass.php' (include_path='/var/www/html/vendor/pear/pear_exception:/var/www/html/vendor/pear/console_getopt:/var/www/html/vendor/pear/pear-core-minimal/src:/var/www/html/vendor/pear/archive_tar:.:/usr/share/php')
in DebugClassLoader.php line 156
Also, the site is not functioning http://shop.farmtruster.com it shows Not Found.
The requested URL was not found on this server.
I'm trying to host in AWS in an EC2 instance I've installed xampp first but then it stopped suddenly functioning so I installed manually PHP MySQL apache...
The website files are in var/www/html folder Note that http://shop.farmtruster.com redirects me to http://shop.farmtruster.com/fr/ so I've concluded that traduction is working.
I hope you can help me
Debug steps:
Check if that .php file does exist in that location, if not copy it (them) over from the original Prestashop archive.
Remove the var/cache completely, it'll get recreated.
Check the files and directories ownership/permissions. The owner should be the apache user and the permissions 0755 for directories and 0644 for the files.
I just started using Fortrabbit to host the app we are working on. I am using Laravel 4. For some reason there are a select few .css fils and all of my .js files are not accessible. I am getting a 403 access forbidden error. How do I get around this. I have made sure the files are there, but for some reason I am unable to access them. I even tried running chmod 777 and 775 on my assets directory.
Access forbidding errors usually relate to some kind of (overzealous) .htaccess rule. I'd recommend to open a ticket with the App name and URLs to the problematic files..
My application was working fine, I dont know what happened suddenly image upload function stoped functioning.It gives this error-
URL file-access is disabled in the server configuration in D:\Hosting\6448289\html\upload.php on line 112
for any file access allow_url_fopen must be ON but this is OFF now.
if you open this link - www.shizin.com/phpinfo.php
you can see that allow_url_fopen is OFF. My hosting compny is GoDaddy.com.
How and Where I can access php.ini file of my project so that I can set it ON or is there any php commands that can be run to set this permission ON.Please suggest.
You will probably have a custom php.ini or php5.ini file somewhere in your account. Launch your FTP client and find it.
Found via Google:
http://community.godaddy.com/godaddy/tips-for-protecting-your-php-based-website/
http://community.godaddy.com/help/article/5647
I uploaded a basic python script to my shared hosting at Dreamhost, and changed the permissions to 777. It ran fine from the shell (via SSH) but would display a 'Server Error' when called from the browser.
In the error.log, the error was 'Premature end of script headers'.
I wrote to DreamHost, who (surprisingly quickly) replied by changing the permissions to 755, and the script started working properly in apache (I could see the output in the browser).
But this doesn't seem right - how can adding extra lenient permissions break anything from functioning?
Allowing anyone to edit a CGI script means that it would be easy to insert a backdoor into the system. httpd is correctly disallowing a suspect program to be run.