Hosting a static webpage in a subdirectory of OwnCloud

Status
Not open for further replies.

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
I'm trying to host a static HTML page with a few files linked in a relative directory. I want it to be able to be accessed through a subdirectory of my domain (ex. http://mydomain.com/subdirectory), but OwnCloud automatically redirects invalid URLs to the OwnCloud login page. I have my files placed in a directory in the root of OwnCloud's webserver (owncloud_1/usr/pbi/owncloud-amd64/www/owncloud). Navigating directly to http://mydomain.com/subdirectory/index.html does properly load the page, but navigating without the /index.html does not work properly.

The owner and group of the subdirectory and all files are www and the permissions are currently set to 0755 (though I've tried 0777 to test and it didn't work then either).

I've been able to get this to work in the past, but every time OwnCloud updates, I guess it resets the permissions or something and I have to figure out what I did the previous time to get it working properly again. This time I can't figure it out, so any help I can get would be greatly appreciated!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
this has nothing to do with permissions. with owncloud 9+, owncloud's htaccess captures all URLs and either serves them if they are on a whitelist or rewrites them to index.php.

hosting a webpage under owncloud is not supported. you would need to edit its htaccess, which would then fail file verification checks, and changes would also be overwritten with any future updates.

If you hosted owncloud with nginx (by install the package or installing owncloud manually) instead of apache you would not be reliant on the included htaccess. you could do whatever you want by configuring your nginx config.
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
this has nothing to do with permissions. with owncloud 9+, owncloud's htaccess captures all URLs and either serves them if they are on a whitelist or rewrites them to index.php.

hosting a webpage under owncloud is not supported. you would need to edit its htaccess, which would then fail file verification checks, and changes would also be overwritten with any future updates.

If you hosted owncloud with nginx (by install the package or installing owncloud manually) instead of apache you would not be reliant on the included htaccess. you could do whatever you want by configuring your nginx config.
Awesome, I found your guide from a few years ago about how to do that. I'll try that out and see how that works!

Do you know why it would have worked in the past though? It doesn't make sense that it would have worked previously and all of a sudden stop working when the htaccess has never been edited.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Awesome, I found your guide from a few years ago about how to do that. I'll try that out and see how that works!

Do you know why it would have worked in the past though? It doesn't make sense that it would have worked previously and all of a sudden stop working when the htaccess has never been edited.
owncloud ships the .htaccess file, newer versions are different. It doesn't matter if you never edited it if you are using a newer version then before.

owncloud version 9 had some major changes with URLs, to cleanup URLs and I think for some other reasons. Only a few specified php files were actually ever browsed to directly, most URLs where instead routed through 'index.php". I think they called the feature "front_controller"
 

Jrjy3

Dabbler
Joined
Jan 3, 2015
Messages
23
owncloud ships the .htaccess file, newer versions are different. It doesn't matter if you never edited it if you are using a newer version then before.

owncloud version 9 had some major changes with URLs, to cleanup URLs and I think for some other reasons. Only a few specified php files were actually ever browsed to directly, most URLs where instead routed through 'index.php". I think they called the feature "front_controller"
Finally had some time to get this done and it worked well! The only issues I ran into were that php70-APCu and php70-redis were not found, but I got past it by running
Code:
pkg install autoconf

and then
Code:
make install clean -C /usr/ports/devel/pecl-APCu


Now to get YOURLS working... I'm not very experienced with nginx and mysql, but it seems simple enough! Thank you for your help!
 
Status
Not open for further replies.
Top