Bizarre permission denied problem accessing images on a web server - html

I am unable to figure this out. I was creating a new page to display entries to a photo contest and it's not working for some reason I can't figure out. The new page is almost a clone of an existing page from an earlier photo contest that is working. After spending hours trying to figure it out, I'm stumped.
I'm running an Apache/2.4.38 (Debian) Server at home for testing web sites. In this case the file structure is like:
site/images/contestname/
where I have multiple contest names, each with its own directory. The directory permissions are the same in each case - the default for any directory created below "images", which is the default for any directory created in the "site".
The photos in all the directories all have the same ownership and permissions too - owner me, group www-data, with a+r (owner and group can also write).
The simplest manifestation of the problem is if I use a web browser to view the directory (http://mylocalsite/images/contestname/). This shows the list of files in the directory but when I try to view one, I get:
Forbidden
You don't have permission to access this resource.
It's only happening in this one directory. In all the others, I can click on a file name and see the image. I've tried recreating the directory and moving the images to the new one but that didn't change anything. It's also not browser related as it's happening with both Firefox and Chromium.
Does anyone have any idea on what the problem may be?

Related

Web development with PuTTY and SSH: Why is the webpage I'm trying to change the code for linking to a deleted directory and not updating?

This is my first time trying web development and creating an actual website (not just a page on Repl or independent html/css page). I have a domain name, and the website connected to it that I'm trying to edit previously had some code on it.
I'm trying to use PuTTY and SSH to transfer the html and css files I want to the remote location.
However, this is what the user point-of-view looks like right now
I'm really confused because gittwo is a directory (with the html + css files I want) that I already deleted. I'm also confused why the main website shows a link to that directory instead of just displaying the image of the website I want. Before gittwo was deleted, it was directly under the main directory where code for the website should be.
Furthermore, now that gittwo is deleted, I'm wondering why the webpage still displays a link to that directory instead of showing the new directory I created, public_html. This is how the main directory looks like on Putty Do you know why this is happening?
I'm really new to all this and I know I'm confused about more things than one here and my question probably reflects that, so please let me know what parts I could maybe clarify!

Files not showing in htdocs

When creating a new database through PHPMyAdmin and trying to access localhost/newdatabase, I get this message:
"Object not found! The requested URL was not found on this server. If
you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404 localhost Apache/2.4.34 (Win32) OpenSSL/1.1.0i PHP/7.2.9"
The file doesn't show in xampp/htdocs either, only in xampp/mysql/data.
If i create files directly in htdocs, they work perfectly on localhost/.
Why has the file not been created in htdocs?
The content of the htdocs folder are files that can be interpreted by the browser such as HTML5, CSS, JS, etc... in order to show a webpage along with it's funcionality to whoever accesses it. A database in the other hand can't directly be opened by a browser, but rather accessed within the server by a backend language like PHP, in order to get the information that can be stored in it through tables. You seem to be new to web programming, so I'd recommend to quickly google some beginner tutorials that can help you to understand the most important concepts. To take on from your kind of confusion, I'd point you to expand your knowledge on these concepts:
HTML5
CSS
PHP
MySQL
Once you get the grasp of them and identify each by their core funcionality, you'll be good on your way to make webpages. Later on you'll find yourself with demands like making your webpage look nice and clear, and also to make it load fast, but there's time for everything and the concepts I pointed are the best start for you.
if you wanna open your database URL = http://localhost/phpmyadmin/
File directory ~ xampp/htdocs for source code such as extension file .php .html .js or other.
if you wanna load localhost a URL is http://localhost:80 (auto find index file to first load)
Sample given as image folder for my code. Hope that can help you to understand xampp

Can't find pages' URL after database renew Wordpress

I have a Wordpress site since a couple year hosted on a trusted domain. A couple weeks ago i forgot to renew my mySql database and obviously the site went down. To give my user a way to contact my shop i created another index.php and, after saving the old index.php given by the Wordpress theme, i deployed it on the server using Filezilla. Yesterday my domain was renewed and they told me everything is working, so i deleted my new index.php page and i deployed back the one got from the WP theme.
Now the home page works wonder, but if i try to show any other page i get a "Not Found - Requested URL was not found on this server". I tried to create another simple page to see if that works, and i get the same error. I didn't change anything in my file system bar index.php, and i'm pretty sure that's the one i used to have before my database went down.
Any ideas?
First of all, thanks #mevius for your answer. Unfortunatly that was one of the first things i tried and it didn't work. What i ended up doing was download the content of my MySql DB and exported all the tables into another DB that shared the host with the first one. After doing that i edited the wp-config file changing the DB name and my website works like a charm again. Thanks!

Magento images not showing anywhere

I just installed a fresh copy of Magento 1.9.2.3. Now my issue is when I try to upload any images, be it product, category, transactional email, ect. it gives me the little broken image placeholder. Now the steps I have tried so far:
Changed \media folder to 777
Flushed all Cache (Magento and images)
Read endless questions on similar issues but to no avail.
This is happening in the frontend and Admin
I have checked the link it creates to the image and when I put that in the address bar it gives me a "404 not found" error.
I have checked that the image is indeed uploaded to the folder that the site is pointing to.
Note: I have had Magento running on this server previously, but it is one to two versions older.
URL is http://southernperformanceparts.com - In case you want to take a look
Screenshot
Can anyone give me some direction here.
Thank you in advance.
Seems to be a right problem.
Are the images set to 644?
You could change your Uploader.php (lib/Varien/File)
search for "chmod($destinationFile, 0640);" and change it to 0644
and search for
"if (!(#is_dir($destinationFolder) || #mkdir($destinationFolder, 0750, true)))" and change it to 0755
In the future the images should get the correct rights after uploading.

How do I structure modx pages so they aren't all at the root URL, whilst being organised in a folder in the manager?

I'm developing my site in modx, and have some custom error pages that I want to group in a folder called "error", and I want them to only be accessible through domain.com/error/page.html. I've already placed the custom error pages in a container called error, which basically looks like the image below.
Only the pages are still only accessible from the root (so from domain.com/page.html), even though they are now in the "error" container. How do I change it so that when people see my error pages, they'll see the url: "domain.com/error/page.html"? Does anyone know how to do this?
p.s.: I've already figured out that I can influence the url of a page by typing the desired url in its "alias"-field. So an alias of "error/page" would mean it can be found at "domain.com/error/page.html".
But the weird thing is that this no longer works when I put the pages in an "error" folder. When I do that I can access the folder itself through domain.com/error, but no longer the pages in the folder at domain.com/error/page.html
Look in your system settings for the error page & access denied page, just set those to the IDs of the custom pages you have created. If you want custom pages for other error codes, you may have to use some redirect rules in an htaccess or apache config file. Some of them will probably never work [like 500 errors] in which case you would have to use a static html file & the server configuration to point to it.
as for setting the path - you will have to set your furls [more system settings] to "use friendly alias path'
also - clear your cache, with modx when in doubt clear the cache...