Hi,
I need to set up a new Ubuntu server for hosting multiple websites. Which steps should I follow for maximum security and performance?
Specifically:
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!
@aguilar1181, thanks but it’s not an option now. I need to do it myself and I’m looking for helpful advices
This can be done with a combination of Apache’s mod_userdir and SFTP chroots. To limit an SFTP user to their home directory, you can edit /etc/ssh/sshd_config to include:
Match User username
ChrootDirectory %h
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
Then enable mod_userdir with:
sudo a2enmod userdir
sudo service apache2 restart
Now files in /home/username/public_html will be available at:
http://your.ip.address/~username
hi @asb,
that’s not what I want. I will set up a Virtual host for each client with custom domain name.
If Apache process runs as one single user, like www-data or apache, clients can read each other’s files.
Should I run an Apache process by a separate user for each client? Or should I use chroot jailing for Apache?
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.