novafacile / novagallery

novaGallery - a beautiful and and ease to use php image gallery for your photos - flat file - no database required - modern responsive design
https://novagallery.org
GNU Affero General Public License v3.0
74 stars 11 forks source link

installed fine but images/albums don't appear #4

Closed dchmelik closed 2 years ago

dchmelik commented 2 years ago

I installed novaGallery at my homesite: it says novaGallery, and my site name, fine. I copied art into galleries/ . However albums say 404. I don't use .htaccess (I'm administrator) rather than main configuration (so don't know I need RewriteBase or what it is.) It's only an Arm CPU server so might take long to generate thumbnails, but I might move to a x86 CPU server.

david-novafacile commented 2 years ago

Wich kind of webserver do you use? Apache2, nginx or other?

It's required to config the rewrite rules, because every request has to be handled by the index.php in root directory.

For Apache2 this can be configured in the .htaccess file (file is included). For other webserver you must set this in the server config.

This is the same principle and behavior as with any other PHP software with pretty URLs (e.g. like Wordpress, Nextcloud).

If you install the gallery in a subfolder of a domain (e.g. mydomain.com/novagallery/), you have to set this as RewriteBase in .htaccess

Example: RewriteBase /novagallery

If you install it on root Domain (e.g. mydomain.com) than it's only RewriteBase /.

Does that help or are you using a web server other than Apache. For nginx I can also provide you with a possible configuration, but then you have to adapt it to your personal config.

It doesn't matter if you have an ARM or X86 CPU. The webserver config is important and maybe if you have enough RAM and if the PHP process can consume the RAM (this is in the php settings). But on your site, it looks like the missing rewrite rules.

dchmelik commented 2 years ago

I admit I use Apache (might switch later) but will never use .htaccess, as unnecessary for root, who should put all that in main configuration files (*.confs in in /etc or /usr/local/etc ) rather than harder-to-find places. The .htaccess is designed for shared hosting you don't have root, only for/in your own directory. I don't know much/anything about mod_rewrite (once I installed MediaWiki (PHP software that runs Wikipedia) but just copied & pasted & modified from MediaWiki.org instructions.)     I tried RewriteBase (as your example) in my main/top-level website virtual host (vhost... one wouldn't necessarily need vhosts, but I have subdomains) but it said only valid in 'per-directory configuration files,' which are unnecessary. MediaWiki uses RewriteRule & RewriteCond (in vhosts) but I don't know those could be used for same purpose.     It's not the front page but embedded/frame, full-page davidchmelik.com/novagallery . If I get it working, it'll move to 'gallery' (but leave novaGallery tag at top) which currently has zenPHOTO, which is good/powerful, but its programmer/developer apparently never installed/used it on a server he has root on, so issues arise, and it's overkill for my simple usage: I don't need something doing more than novaGallery, so it's very interesting...

david-novafacile commented 2 years ago

It really looks like missing ModRewrite configuration.

Unfortunately I am not an expert in Apache configuration either. The easiest way would be to enable in your vhost the possibility to use .htaccess and the mod_rewrite module.

Then you can use any PHP software that uses .htaccess for configuration. This is usually also standard, unless you explicitly don't want to do that for certain reasons and want to set everything individually in the vhosts.

david-novafacile commented 2 years ago

Maybe this helps:

Enable .htaccess https://webrewrite.com/enable-htaccess-file-apache2/

Enable mod_rewrite and use htaccess: https://stackoverflow.com/a/5758551

dchmelik commented 2 years ago

Perhaps was because I worked on this late at night, I didn't notice everything and got a bit confused. I see novaGallery already has its own .htaccess file, but for some reason I thought the command was supposed to go somewhere in my own main Apache configuration, how I usually do things. So, I just enabled .htaccess, updated that line, and now it's working! :D