0

I am using an Ubuntu 20.04.2 LTS Server and Apache 2.4.41.

I´ve installed pureFTPd with mySQL and inserted some test users. The users register in a frontend and then they are created in the SQL Database via PHP. It works fine. But I want all users to be able to host a website. For this I installed the mod userdir for Apache. This mod needs a subdirectory in the home folder, in my case public_html.

Is there a possibility to let pureFTPd create this folder automatically as soon as the home directory is created?

stuckoverflow
  • 625
  • 2
  • 7
  • 23

1 Answers1

0

Some details on your pureFTPd/mysql setup would be helpfull.

TL;DR: PureFTPd doesn't support home directory template/skeleton https://serverfault.com/questions/615487/create-home-directory-from-skeleton-upon-ftp-first-login

Also the userdir apache module rely on system auth to map username to home directory, if you only setup pureFTPd to query a mysql user database it won't work the way you expect.

You would need to make this mysql database a system authentication base by using components like libpam-mysql and libnss-mysql, given this setup in place you could then use pam-mkhomedir to spin-up a home directory template with this public_html folder.

I wouldn't recommend this however, a mod-rewrite based solution with a username.domain.tld mapping to /path/to/ftp/user/htdocs would be probably safer, and combined with Pro-FTPd ability to create the home directory based on a template this could work the way you want.

Of course there is also a third and probably simpler way: have your user-management interface create the home directory the way you want it.

silmaril
  • 423
  • 3
  • 10