Coder Social home page Coder Social logo

404 /page not found about novagallery HOT 18 CLOSED

novafacile avatar novafacile commented on May 23, 2024
404 /page not found

from novagallery.

Comments (18)

david-novafacile avatar david-novafacile commented on May 23, 2024

Hi, this sounds strange.

Can you please post the content of

  • nova-config/site.php
  • .htaccess

The images are in galleries right? (You wrote galeries)

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

Yes, that was a typo, thanks for your fast reaction. I edit the htaccess, tried also RewriteBase / no result
I call with http://192.168.0.108/novagallery/index.php is that right shouldn't there be an argument?
I am still curious about the needed value of BASE_PATH, i have the feeling that it goes wrong there.

site.php:

{
"siteName": "novaGallery",
"siteTitle": "The Simple Gallery",
"metaTitle": "novaGallery",
"metaDescription": "novaGallery - beautiful php photo gallery.",
"footerText": "Ā© 2021 by novafacile OĆƒÅ“",
"theme": "novagallery",
"url": "https://hansiart.mooo.com/novagallery",

"language": "en",
"allowedImageSizes": [
"400x400",
2000
],
"imagesDirName": "galleries",
"imageCache": 1,
"imageSizeBig": 2000,
"imageSizeThumb": "400x400",
"imageQuality": 89,
"sortAlbums": "newest",
"sortImages": "newest",
"fileListMaxCacheAge": 60,
"pagePassword": ""
}
.htaccess
RewriteEngine on
RewriteBase /novagallery/

Deny direct access to the next directories

RewriteRule ^nova-config/.$ - [R=404,L]
RewriteRule ^nova-base/.
$ - [R=404,L]
RewriteRule ^nova-languages/.*$ - [R=404,L]

All URL process by index.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [PT,L]

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

If i call with 192.168.0.108:/novagalley i get some result, if i click something i get a not found or an alert.
it tries to open the link http://192.168.0.108/novagallery/album/columns, which is non existent.
when i click a photo, the link to the cache = mysite.com/novagallery//cache/2000/00001.jpg the double slash is that right?
No cache can be found in /novagallery.
pic2

from novagallery.

TheBarret avatar TheBarret commented on May 23, 2024

I got the same, its looking for cached images, but these are never made.
This can be done much easier, i dont know why you made it so ..overcomplicated. lol

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

This can be done much easier, i dont know why you made it so ..overcomplicated. lol

Thanks for the constructive comment. The nice thing about open source, everyone is allowed to make suggestions for improvement. A few optimizations regarding thumbnail generation are on the roadmap but if you have a better idea that doesn't require a database and admin interface, feel free to contribute. We are open for pull requests or concept ideas ;-)

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

If i call with 192.168.0.108:/novagalley i get some result, if i click something i get a not found or an alert.
it tries to open the link http://192.168.0.108/novagallery/album/columns, which is non existent.

This is strange. Wy "columns"... this can be caused by an php error. Which php version do you use?

when i click a photo, the link to the cache = mysite.com/novagallery//cache/2000/00001.jpg the double slash is that right?

The name of the album is missing. This should be between the duouble slashes The question is, why...

Is it a shared webspace at a hosting provider or is it a self installed server.

from novagallery.

 avatar commented on May 23, 2024

columns is a subdir of galleries in which i have 6 photo's. I run a self installed server, linux debian buster. PHP 7.4.3
Who should have write permissions on /novagallery/ ? The album dir is not created so maybe a matter of permissions?
Does the https://mysite.com part of the url in site.php play any role, because when i leave it out i get the same behaviour. What should be the value of BASE_PATH ? If i knew that i could help to investigate the problem.

from novagallery.

TheBarret avatar TheBarret commented on May 23, 2024

This can be done much easier, i dont know why you made it so ..overcomplicated. lol

Thanks for the constructive comment. The nice thing about open source, everyone is allowed to make suggestions for improvement. A few optimizations regarding thumbnail generation are on the roadmap but if you have a better idea that doesn't require a database and admin interface, feel free to contribute. We are open for pull requests or concept ideas ;-)

Im not here to add insult or useless critics, i genuinely got interested using this but noticed it was just made
so complex. I always abide by a known method called KISS (Keep It Simple, Stupid!) (look it up, thats not made up) :)
Been using this method for over a decade, always best approach.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

Who should have write permissions on /novagallery/ ? The album dir is not created so maybe a matter of permissions?

This really sounds like a write permission problem. The webserver must have write permissions in the galleries directory and subdirs, even if you create and upload albums and images. If you setup your system by your own, there are a couple possibilities to provide this (chmod, owner, group) but this is webserver configuration based on your individual server setup and difficult to say here how you should do this. I think there a better support communities for that, than here.

Does the https://mysite.com part of the url in site.php play any role, because when i leave it out i get the same behaviour. What should be the value of BASE_PATH ?

If you can click on an album and your are still see the novaGallery (the 404 error page too), than base path and URL are correct. You should add the full path domain in site.php (how you did) to be sure, that every theme and feature works correctly.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

Im not here to add insult or useless critics, i genuinely got interested using this but noticed it was just made
so complex. I always abide by a known method called KISS (Keep It Simple, Stupid!) (look it up, thats not made up) :)
Been using this method for over a decade, always best approach.

That's interesting and I'm seriously interested to talk about optimizations with you. Because KISS is the principal how we work. I am always interested in exchange for better approaches to reach the best KISS solution.

This is the reason why novGallery works how it works and it is developed (we missed a tool like this):

  • just simple php
  • possibility for simple installation and configuration and running on almost every simple webspace
  • no database
  • one class for files handling incl. simple caching
  • one class for image handling
  • simple theme support
  • simple basic system with routing
  • some simple but effective security features

Of course, inside every class and sub feature are still possibilities for optimisations.

If you have experiences or ideas for developing simple image galleries with low setup and management requirements let us discuss to find the best way.

If you really interested, just open a new issue and let us talk about that. I'm seriously, I'm really interested.

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

So if i have https://mysite.com/novagallery in site.php:
What exactly should be the value of BASE_PATH ? (3th time i ask this)
and:
In my case the owner of /novagallery is root. Is that correct? Or should it be www-data or something else? I am not asking how to set permissions, just want to know what they should be.

when i have https://hansiart.mooo.com/novagallery in site.php i get:
pic3
when i have just /novagallery in site.php i get:
pic4
When i make www_data owner of /var/www/novagallery and set all permissions to everyone i see that in the directory galleries a directory 'cache' is made with files.php in it.
This file contains
{"images":{"pic2_1.jpg":1660987468},"albums":{"columns":{"0001.jpg":1331128192,"0002.jpg":1331128192,"0003.jpg":1331128193,"0004.jpg":1331128193,"0005.jpg":1331128193,"0006.jpg":1331128194,"pic2_1.jpg":1660987468}}}
So something happens anyway now. The problem sill is that there is no /novagallery/albums/columns directory, and there is no "columns" between those slashes in the link to the photo's.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

The base bath in .htaccess must be the subfolder. In your case /novagallery/

This is required for the apache mod rewrite as base, that the apache webserver knows where to route the requests. Do you have installed mod_rewrite in apache and activated, that .htaccess can override settings?

Your webserver and the php process needs to have write permissions to the galleries directory. I don't know how you set up your system:

If apache and php running as www-data, then it has to be www-data, if it's root, than root, if it's web than web or whatever. If the apache/php is running as www-data but you want, that a system user is the owner of the gallery folder, than you can add both in a group and set directory permissions to 0775 or if everyone should have writing permissions you can set directory permissions to 0777. The common way is, that the directorys owner is www-data and webserver and php are running as www-data. But this is sever configuration and depends on your personal preferences and requirements.

If the cache folder and the file files.php is generated, than you are on the right way.

The url in site.php is just the url where you running the novaGallery. No more and no less.

If you running under http://192.168.1.1/novagallery then it should be exactly that: http://192.168.1.1/novagallery

If its running under http://mysite.com/photos than it's http://mysite.com/photos

If it's running under https://mysite.com/photos than it's https://mysite.com/photos

You can try to use a relative url but, this can be buggy. This will be fully supported in one of the next releases.

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

Oke, rewrite was enabled and .htaccess contains RewriteBase /novagallery/ i issued a chown -R www_data:www-data var/www/novagallery and checked that all php files are executable by the owner. Changed the owner of .htaccess back to root. Apache/php running as www-data.
Nothing in the apache2 error.log as to failed permissions.
So this should rule out the permissions question?

http://hansiart.mooo.com/novagallery/album/columns still not created.
also not created http://hansiart.mooo.com/novagallery/galleries/columns/cache/400x400/pic2_1.jpg
This means that the php is not working properly.

The cache directory however is still created but i think at the wrong place and without jpeg's.
I have the idea that cache's should be in de subdirectories of galleries right? I added another subdir named paintings. No new cache is made and the old one stays unchanged. Then i removed cache and refreshed the page. Now a new cache is made in galleries/ with the new dir mentioned in the json.

apache2/accesslog:
GET /novagallery/galleries/columns/cache/400x400/pic2_1./novagallery/galleries//cache/400x400//novaga
llery/galleries//cache/400x400/jpg HTTP/1.1" 404 443 "http://192.168.0.108/novagallery/" "Mozilla/5.0
(Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"

browser console:
http://hansiart.mooo.com/novagallery/nova-themes/novagallery/assets//bootstrap.min.css.map this seems also a broken link with 2 slashes.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

That with the 2 slashes is strange, I will take a look later. This shouldn't be, but on most systems this shouldn't be a problem.

On your system it's also working: http://hansiart.mooo.com/novagallery/nova-themes/novagallery/assets//bootstrap.min.css

The error with missing map file is no problem, this is only required for debugging the minified bootstrap css file in browser developer tools.

When I click on an album on you website it appears the apache 404 error. This means, the mod rewrite and/or htaccess settings in apache config and/or htaccess is wrong.

Your .htaccess should contain this:

RewriteEngine on
RewriteBase /novagallery/

# Deny direct access to the next directories
RewriteRule ^nova-config/.*$ - [R=404,L]
RewriteRule ^nova-base/.*$ - [R=404,L]
RewriteRule ^nova-languages/.*$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [PT,L]

This seems to be the reason wil the images are not genereated. If you request an image url, it's the same.

Is mod rewrite enabled correctly? Looks like the same issue than an other user had, with is apache config:

#4 (comment)

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

root@webserverpi2:/etc/apache2# a2enmod rewrite
Module rewrite already enabled

I had to change the entry for /var/www in sites available to:
AllowOverride All
Order allow,deny
allow from all

I already posted my .htaccess which looks perfect to me.

Anyway, now i get one step further. As you can see for yourself.
In the caches there is no 400x400 created so there are no thumbs. No 2000 is created. Everything is owned by www-data and writable. Get no errors from apache log

In Router.php i always come to the comment "// No matching route was found" is that right?

Are there any special demands as to the jpegs, in site.php, allowed images size what does that do exactly?

When i go to http://hansiart.mooo.com/novagallery/galleries/paintings/0001.jpg i get a photo
After setting some debug options in php i get errors in the apache error.log, These seem to be related to the missing directories.
_PHP Notice: Trying to access array offset on value of type null in
/var/www/novagallery/nova-base/lib/novaGallery.php on line 212, referer: http://hansiart.mooo.com/novagallery/

if i manually create the dir novagallery/galleries/paintings/cache/2000 and put a picture in, it works. So the php that should do this doesn't work. Which file is that btw, maybe i can find the trouble myself.

I removed the subdirs of galleries, refreshed the page and made new directories with jpg's. With owner www-data and write permissions. Refreshed again and checked the apache error.log. Nothing, where i expected that the erroneous php would would betray itself.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

Are there any special demands as to the jpegs

No.

in site.php, allowed images size what does that do exactly?

This is to protect your server, to prevent that everybody can resize images an generate a high workload at the server.

if i manually create the dir novagallery/galleries/paintings/cache/2000 and put a picture in, it works. So the php that should do this doesn't work. Which file is that btw, maybe i can find the trouble myself.

The "magic" is happen in /nova-base/lib/Image.php.
You can try to change the dir permission on line 150 to 0775 or 0755. Maybe 0777 ist to "open" for your server configuration

Change

mkdir(self::$cacheDir, 0777, true);

to

mkdir(self::$cacheDir, 0775, true); 

Please also check allowed ram, that a php process can check. Maybe it's to small for image handling. In some default configurations it's less than 128 MB.

from novagallery.

patience4711 avatar patience4711 commented on May 23, 2024

changing that line does not make difference, the cache dir is created, that is:

  • in novagalleries/galleries
  • in novagallery/galleries/sculpt and in novagallery/galleries/paintings
    These dirs are owned by www-data and writeable

The problem is that there are subdir 2000 or 400x400 and no files in them only a files.php.

This is to protect your server, to prevent that everybody can resize images an generate a high workload at the server.

Does it mean that everybody can resize files in some way? I hope not, only by clicking the thumbs i hope.
And i cannot understand this concept. I had "allowedImageSizes": [ "1400x1400", 20000 ] in site.php, because of the failures, i experimented with these values. Does that mean that an image can be resized to max 400x400 pix? or size 20000 bytes Kb Mb ??? What values can be used here?

I changed that back to the original value and.... now it works. And it looks nice. However i must say that i wasted a lot of time on this. To you it all seems simple php and simple this and that. You think that the very brief instructions in the readme are enough for everyone to get started. If i would have known what the functions are of the settings in site.php i probably had found this hours and hours ago. The a2enmod and .htacces conditions could have been mentioned in the readme. Or a page in the wiki with a somewhat more extensive installation instruction. It can save you a lot of work too.

from novagallery.

david-novafacile avatar david-novafacile commented on May 23, 2024

Does it mean that everybody can resize files in some way?

No. That's the reason why there is a protection with allowed image sizes.

Good to see, that it works.

I can understand your point, the documentation is one of the next steps on the roadmap. Most people just use the default values on shared webspace. For this it's just upload, set URL, add images and it works.

Since the last release most issues has to do with individual server setups. Forgot server installation basics like enabling mod_rewrite or htaccess support or permission settings. This has nothing to to do with novaGallery, but I understand, that it would help to mention this in the documentation.

Your are absolutely right, it can be difficult to understand the concept of allowedImagesSizes. In the next major release we will change this concept into an easier way. And of course, with a better documentation ;)

And i cannot understand this concept. I had "allowedImageSizes": [ "1400x1400", 20000 ] in site.php, because of the failures, i experimented with these values. Does that mean that an image can be resized to max 400x400 pix? or size 20000 bytes Kb Mb ??? What values can be used here?

This are pixels and must be the same you use in size settings or in an individual theme.

You can add one value, this means, this is the maximum of width or height (depends what higher). Or you add 2 values (height x width), than it's cropped to this size.

from novagallery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.