var/www to home/user/public_html?

  • Posted 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?


Submit an 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.

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?

@Farooq Yousuf: That should be fine. The only issue you might face is if you are trying to run multiple site from the droplet, but it’s really only a matter of personal preference and organization. You can setup apache to serve files from anywhere. It’s just keeps things organized nicely to use layouts like: <br> <br>/var/www/ <br>/var/www/

Kamal, <br> <br>Mistakingly I put my site contents directly in /var/www and not in /var/www/ 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/ If I move the files, do you think it will cause any issues for my sites?

<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/</code> <code>/var/www/</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=“”></a>. It’s installed by default and it much more secure.