By GroovySTK
Hi, I just set up a LAMP droplet following the 1-Click install guide. It worked fine, i have ssh access
I am now logged in as root.
The web root is now at /var/www/html which can be accessed through the droplet’s public ip or the domain name i ‘attached’ following this part of the guide :
... Two DNS records:
An A record from a domain (e.g., example.com) to the server’s IP address
An A record from a domain prefaced with www (e.g., www.example.com) to the server’s IP address
Now, i would like to create 2 users. Each one will be for managing a distinct website (distinct domain name and folder)
I tried doing this vhosts configuration a few months ago (not on digitalocean droplets), i had tons of file permission related errors
Is there a guide that i can follow for this specific usecase ?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @GroovySTK,
I’ll recommend using an Apache Module : apache2-mpm-itk. This module is an MPM module for the apache web server which allows you to run each of your virtual host under a separate uid and gid i.e. the scripts and configuration files for one virtual host are completely separated from that of others and therefore no longer have to be readable for all of them.
First step is to install apache2-mpm-itk and enable it in order to use its functionality :-
sudo apt-get install apache2-mpm-itk
sudo a2enmod mpm_itk
Now a very simple virtual file for a domain should look like
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/user1/public_html/
<IfModule mpm_itk_module>
AssignUserId user1 user1
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Notice the
<IfModule mpm_itk_module>
AssignUserId user1 user1
</IfModule>
That’s your way of separating with users.
Regards, KFSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.