Userdir module enabled with PHP ( http://myDomain.com/~username/test.php )

We are using Hestia, and we configured it to enable all users to have a public_html subdirectory in order to publish simple webpages at their own directory, without creating web domains.
We’ve seen that userdir mod is enabled by default, so what we did was:

  • At /etc/skel create a public_html folder with a simple html as example.
  • At /etc/php/7.4/fpm/pool.d/OurMainDomain.conf, added /home to the open_basedir directive. Something like /home/*/public_html didn’t worked… Is there any way to restrict it just to public_html or we have to allow /home ?

Restarted fpm service
sudo service php7.4-fpm restart

Later we will do some simple PHP API, so we also modified
/etc/apache2/mods-enabled/userdir.conf
in order to allow PUT and DELETE methods

Do you think is there any problem with that configuration? Is this the proper way?

Thanks for any suggestion

We know is better to work under a domain, so users can also access log files. But for the very first sessions it is useful to work directly under their own subdirectories without creating anything else.

We are a vocational training center (computers :wink: , so our users first creates simple pages, and later we show how to “buy” a subdomain in our “hestia-hosting”, and how to publish and maintain it.

Thanks

  • Ermengol *

Hi,
I don’t want to appear negative, but I think possibly for this case, Hestia is the wrong tool. I think what you should be looking at is a simple server set up with just apache and maybe php, mysql if required. This could be done on a cheap VM somewhere.
The reason I’m suggesting this, is that the way hestia is designed is to have user files in specific places, and hestia users aren’t necessarily mapped to linux users on the system. I think you’d end up having to modify so many files, that in the end it would have been quicker to just set up a simple apache server.
Maybe hestia will prove useful for later stages of the course.
I’m not on the development team, so this is just my personal take.

2 Likes

Create with an api a new user + add a new sub domain for each of them. Security is then at a higher level.

With the API it can be automated and it should not take a lot of time…

2 Likes

Do as @eris says or just teach them how to manage hestia first in the course.

Thanks for the replies!
@pluto I understand your opinions but, we don’t need to modify anything else but what I pointed before. User works quite well with hestia (as far as I know they’re do mapped to real users)
For our scenario is very useful, we just have a cheap VPS at OVH, each teacher creates a user for each student with their email, and later they can publish their first html creations and check them from house. For us, is very important this step. They are not used at all to use internet to publish their own content at their own way.
They also have their own VM where they try all of this before, but their VM are not visible from internet :smiley:

@eris , using the api to automate the creation process as well as their first domain, is a good starting point. I’ll look further on it, thanks.

thanks :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.