-1

I run a home server with Ubutnu 16.04 with Apache 2 let say for fun and to improve my linux knowledge

At the moment I have few web applications/websites which are for personal use (bug tracker, forum, cloud and similar)

All this sites are under /var/www

I don't have a DNS and I'm not using virtual hosts. all sites/applications can be reached from outside as: my_DDNS.net/forum my_DDNS.net/cloud . . .

What I'm trying to achieve, pretending to run a proper web server, is to have single user access for each different web directory as on commercial hosts. If it helps the idea is: User: forum -> manage /var/www/forum User: cloud -> manage /var/www/cloud . . . enhancing (I think) security having all directories owned by different users and not only from www-data. At the moment the users are not real ones which can login or install SW, just to manage the sites

This step will also include specific ftp (proftd vs vsftp, suggestions?) access for each users to only a specific /var/www/ directory.

One day I'll probably update my free DDNS service to a pro version which will allow me to have subdomines managed by my local DNS but before it I'd like to streight up these curiosity.

If all above is clear, I'd really appreciate if any of you could help me with suggestions or giving me hints and what to search more specificly

Will be enough to set the home directory of each user the related /var/www/ directory?

Is there any more 'professional' way of doing it?

Cheers

gipsea
  • 1
  • 1

1 Answers1

0

It is easy. You are not using virtual hosts, so it means that you are running one website with several applications inside.
Just configure per-user web directories as it is described in Apache tutorial.
Also you can use the same users and their home folders for FTP.

In case you want each application to be a separate website you will need to configure virtual hosts.

Elvis Plesky
  • 3,190
  • 1
  • 12
  • 21
  • ok for virtual host. I'll take a look to the tutorial u suggest. I'll be back with more specific questions if I'll have some but I hope to solve it without hiccups. cheers – gipsea Jul 27 '17 at 05:44
  • checked. let say – gipsea Jul 27 '17 at 06:34
  • Ok, checked the userdir option as suggested. if I want: user: Robert run the website robert.example.com I guess i need to set the virtual host to the directory /home/robert and server name robert.example.com. won't leave this option the access to the same site from these addresses: robert.example.com and example.con/~robert? what groupd and what chmod should b used for the home directories? I'll give it a go tomorrow cheers – gipsea Jul 27 '17 at 06:43
  • I found this interesting link in askubuntu https://askubuntu.com/questions/849702/userdir-with-virtual-host-apache2. keep you posted. thanks @ElivsPlesky for the hint of using userdir – gipsea Jul 27 '17 at 20:33