This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

autumn
autumn

Hello, I'd like to have October's files outside of the public/www directory of my server while still access front&backends from the public directory.
(I'm not referring to the public folder although it might be related)
The same is possible with laravel based Flarum.

Is it possible and how should I proceed ?

P.S. I discovered a best practice category on this forum but it is not listed.

Last updated

JenniferLopez
JenniferLopez

@autumn

The Artisan command php artisan october:mirror supports a "destination" argument to put the public files wherever you wish, eg:

php artisan october:mirror ./public/www

It is only this folder that needs to be web-accessible. This is generally done through setting the webroot folder in your Apache/Nginx/IIS configuration to point to that folder as opposed to the entire codebase.

autumn
autumn

BennoThommo said:

It is only this folder that needs to be web-accessible. This is generally done through setting the webroot folder in your Apache/Nginx/IIS configuration to point to that folder as opposed to the entire codebase.

This does not look handy at all. Not only does it duplicate files which could be many, it needs to be redone for every system/plugin update, and it makes the webroot dependant on October while I think it should be the opposite.

Why can't I just have a modified version of index.php and admin/index.php to display everything whereever those files are ?? Like they did for Flarum.

JenniferLopez
JenniferLopez

autumn said:

This does not look handy at all. Not only does it duplicate files which could be many, it needs to be redone for every system/plugin update, and it makes the webroot dependant on October while I think it should be the opposite.

The command creates symlinks, not copies of the files. I am not sure what you mean by making the webroot "dependent" on October - this would be the case no matter which system you are using. Something has to process the requests...

autumn
autumn

Assigning a domain name to a directory created and updated by a CMS seems a lot riskier than doing the opposite. But maybe I don't know enough about servers and file handling.

Can you just explain me why it can't be done this way.

JenniferLopez
JenniferLopez

autumn said:

Assigning a domain name to a directory created and updated by a CMS seems a lot riskier than doing the opposite. But maybe I don't know enough about servers and file handling.

I can assure you it is quite safe. It is effectively making it so that no-one can inadvertently read or reveal core system files through the web server. The only files available through the web server would be those that are specifically publicly accessible.

Can you just explain me why it can't be done this way.

Because Flarum have customised the way their app is bootstrapped. That site.php file that it accesses is not default Laravel behaviour.

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.