uiszaman
By:
uiszaman

Like any hosting, how to get home path for a particular droplet?

June 1, 2017 308 views
System Tools Control Panels DigitalOcean Ubuntu

For every hosting, after login, we can see the base home page url in the dashboard. For example,
Home Directory:
/home/sandpit/WebsiteName1.com/
/home/sandpit/WebsiteName2.com/

How to get this path for a particular droplet?

2 Answers

No, there is no such URL, things work little bit different.
You can look at the Droplet same as on VPS - it's not the same as shared hosting. You need to install Web Server, then create directories for your websites. That means, you chose where you want to store your Web site.

This is easy, especially with tutorials DigitalOcean provide.
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04 will help you setup Apache for Web Server as well as PHP and MySQL if you need them.

Second option is to use One-Click images, but this only applies when you're creating new Droplet. In that case, on Droplet Creation, you can choose LAMP image which contains everything from above tutorial.

Once you have Web Server, by default on Ubuntu, you have /var/www/html directory for Web site files.

If you want to setup multiple sites, or use another directory, you have to use Virtual Hosts. You can learn more about Virtual Hosts in How To Set Up Apache Virtual Hosts on Ubuntu 16.04.

A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is...

I'm using serverPilot to install the environment on DO and installing wordpress from one-click images provided by serverpilot.

Say, after server installation my web root directory shows as,
apps/myDomain/public

So, along with the path from DO, what would be the whole path?

/var/www/html/apps/myDomain/public
OR
/var/www/html/srv/users/serverpilot/apps/myDomain/public

I'm asking this as I have to use the absolute path like "/home/sandpit/WebsiteName1.com/" in Fraudbuster cloaker settings..

They show this picking the home directory path from cpanel and amending the content directory path (domain folder) at the end.

All was OK as long as I was working with shared hsoting. But for DigitalOcean, I just can't make this.

Thanks.

  • I think the whole path should be ~/apps/ then followed by location of your WordPress directory.
    If you have to use specific directory, you have to change your Web root, by following How to Use a Custom Web Root Directory | ServerPilot or to change path in plugin, if possible.

  • @uiszaman

    I believe ServerPilot uses /srv, though if you're using PHP and want to get the path, you can drop a file in to your home directory and within it, add:

    <?php echo __DIR__;
    

    When you access that file, it'll echo out the full path to that file. From there, you can adjust the path as needed.

Have another answer? Share your knowledge.