Report this

What is the reason for this report?

var/www to home/user/public_html?

Posted on February 20, 2014

Hello, I’m newbie on VPS configuration but I learn quick. I have a doubt about the server arquitecture.

I want to have my VPS as clean as possible, and in my old webhost server I could see I have two folders with the exact same info: var/www and /public_html

As I understand, var/ww is a backup of /public_html which is the folder where Internet users go when they visit my website, is that correct?

How can I do that on my VPS?

My thoughts tell me that I can create the folder for each site on /home/user/public_html and create the FTP users with limited privileges, but what happens with the var/www folder?



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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

<blockquote>var/ww is a backup of /public_html</blockquote> <code>/var/www</code> the webserver’s default documentroot. Shared hosting panels use slightly different directory names and paths but you don’t have to do the same. <br> <br><blockquote>My thoughts tell me that I can create the folder for each site on /home/user/public_html </blockquote>You can do that but it’s preferred to create a directory for each site in <code>/var/www</code> e.g. <code>/var/www/example.com/public_html</code> <code>/var/www/example2.org/public_html</code> and then storing the files in the corresponding <code>public_html</code> directories. <br> <br>As for FTP, don’t do that. Use SFTP instead: <a href=“https://www.digitalocean.com/community/articles/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps”>https://www.digitalocean.com/community/articles/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps</a>. It’s installed by default and it much more secure.

you can always create a custom folder to point your OS to the root of your vhost. <br> <br>what is your OS? Nginx or Aapche?

Kamal, <br> <br>Mistakingly I put my site contents directly in /var/www and not in /var/www/example.com/public_html. Everything is working fine. I’ve a LAMP Wordpress running. <br> <br>Do you think I should move all the files from /var/www to /var/www/example.com/public_html? If I move the files, do you think it will cause any issues for my sites?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.