Page 1 of 1

CodeIgniter and Vesta

Posted: Thu Mar 05, 2020 2:28 am
by PlayBoxTech
Hi all,
Using CodeIgniter 4, they recommend that the web server is configured to automatically go to folder/public/ as the default. ie: /home/chris/web/ci.audiodrama.stream/public_html/public

Is this possible with Vesta? If so how?

Thanks!
Chris

Re: CodeIgniter and Vesta

Posted: Thu Mar 05, 2020 4:47 am
by plutocrat
Briefly
- Create a new template with the new web root directory. (copy an existing one and rename it).
- Put it into /usr/local/vesta/data/templates/web/apache and/or /usr/local/vesta/data/templates/web/nginx
depending on which web server setup you're using.
- Select it from the vesta web interface for that web domain.

Re: CodeIgniter and Vesta

Posted: Thu Mar 05, 2020 11:11 am
by PlayBoxTech
plutocrat wrote:
Thu Mar 05, 2020 4:47 am
Briefly
- Create a new template with the new web root directory. (copy an existing one and rename it).
- Put it into /usr/local/vesta/data/templates/web/apache and/or /usr/local/vesta/data/templates/web/nginx
depending on which web server setup you're using.
- Select it from the vesta web interface for that web domain.
So I copied the directory apache2 to codeigniter and modified both basedir.tpl and basedir.stpl refreshed the page in Vesta and it doesn't show the new template. Is there something I have to do, to get Vesta to see the new template?

To possibly clarify I don't want to modify every url to go to public_html/public just this one.

Re: CodeIgniter and Vesta

Posted: Fri Mar 06, 2020 3:33 am
by plutocrat
OK, so back to basics. What is your webserver setup? Are you using apache, nginx or apache with nginx proxy in front? I can't give specific instructions until I know that information.

Re: CodeIgniter and Vesta

Posted: Sun Mar 08, 2020 2:41 am
by PlayBoxTech
plutocrat wrote:
Fri Mar 06, 2020 3:33 am
OK, so back to basics. What is your webserver setup? Are you using apache, nginx or apache with nginx proxy in front? I can't give specific instructions until I know that information.
For this site its apache only.

Re: CodeIgniter and Vesta

Posted: Wed Mar 11, 2020 1:49 am
by plutocrat
OK, so here's what I'd do. Go to the template dir for apache, and make copies of the default templates.

Code: Select all

cd /usr/local/vesta/data/templates/web/apache2/
cp default.stpl codeigniter.stpl
cp default.tpl codeigniter.tpl
Now edit those templates so that the path is updated to the one codeigniter uses. You can use nano or another editor of your choice.
In both codeigniter templates find the line that says

Code: Select all

 DocumentRoot %docroot%
and change it to

Code: Select all

 DocumentRoot %docroot%/public/
Save the files. Go to the vesta web interface, domains, and select your new codeigniter template for the domains you need.

You may need to make other codeigniter changes in those templates, eg open basedir settings, php settings. If you make further changes, you'll need to force vesta to regenerate the configs in /home/user/conf/web/, so you'd either select the default template, save, then re-select codeigniter template, save. Or you could use v-update-web-templates

Re: CodeIgniter and Vesta

Posted: Thu Mar 12, 2020 10:08 am
by PlayBoxTech
Thanks I got it to work now.

Re: CodeIgniter and Vesta

Posted: Wed Mar 17, 2021 3:47 am
by sniper69
PlayBoxTech wrote:
Sun Mar 08, 2020 2:41 am
plutocrat wrote:
Fri Mar 06, 2020 3:33 am
OK, so back to basics. What is your webserver setup? Are you using apache, nginx or apache with nginx proxy in front? I can't give specific instructions until I know that information.
For this site its apache only.
I have same problem and I use apache with nginx proxy in front, please help me for this case.