Setting up FTP on a subdomain with Webmin

May 22, 2017 1.1k views
Control Panels Configuration Management Ubuntu 16.04

Hello,
I will start off by admitting that I am new to the world of Webmin and I am new to digital ocean (double threat I guess, hehe). So apologies ahead of time if noobishness inspires face-palms.

Anyways my question is how would one setup a subdomain and then make it an accessible ftp? I am running Webmin 1.840 on Ubuntu Server 16.04 LTS and have already accomplished being able to have ftp.domain.com point to a test.php page and have created a ftp account but I need help dialing in being able to go to ftp.domain.com and being able to see an index of the files / make them a little more accessible. Any good tutorials or videos out there? So far I have found some but still not accomplished my goal yet. My appreciation in advance for all those who read this and major appreciation for all who offer assistance!

TLDR Version:
How would one accomplish setting up the ability to go to ftp.domain.com and see an index of files with Webmin?

1 comment
  • EDIT:
    I realized later I may be too specific what I am attempting to achieve is primarily something like this while running Ubuntu Server 16.04 LTS. Any pointers, tutorials, videos, or even alternative software for it? Thanks!

1 Answer
jtittle1 May 22, 2017
Accepted Answer

@SurfBlue714

With Webmin, to enable FTP, you'll need to install ProFTP.

Webmin => Un-used Modules => ProFTP

You'll then click on the button that says "Click Here", which is followed by "to have it downloaded and installed using APT."

Clicking that button will download and install ProFTP for you.

Now you'll want to go to:

Webmin => System => Users and Groups

Click on "Create New User."

Username        =>  Any username of your choice.
Home Directory  =>  Any path (i.e. /home/youruser)
Shell           =>  /bin/false
Password        =>  Normal Password (any secure password of your choosing)
Primary Group   =>  New group with same name as user

The click on "Create."

You should then be able to login to FTP using the username you just created and the password you set for that user.

  • Hello jtittle,
    Much appreciation for your response! How would one be able to accomplish without a user name / password like going to https://download.gimp.org/ and seeing an "Index of /" with a directory of files that doesn't require user sign in?

    • @SurfBlue714

      For that, you'd need to setup a web server. Webmin supports Apache out of the box. Much like we did for FTP, you'll need to head back to the "Un-used Modules" section, but this time, click on Apache Webserver, followed by a click on the "Click Here" button.

      Once done, go to Servers => Apache Webserver -- you may need to refresh the page if it's not showing up.

      Go and and check the current VirtualHost and hit the delete button, then from there, click on "Create VirtualHost."

      For the settings, we'd use something such as:

      Handle connections to address   =>  domain.com (or sub.domain.com)
      Port                            =>  80
      Document Root                   =>  Choice of Path (FTP Path, /var/www/html, etc)
      Server Name                     =>  Same as Domain or Sub-Domain (i.e. sub.domain.com)
      

      You'll still want to setup the FTP user as I did above as that's how you'll login to upload files.

      You'd then need to go back to Servers => Apache Webserver, click on "Global Configuration" and then "Edit Config Files."

      From the drop down, select the file that contains the domain or sub-domain you just created (normally at the bottom of the list) and click it. Now click "Edit Directives in File."

      You should see:

      Options None
      

      Change that to:

      Options +Indexes
      IndexOptions IgnoreCase FancyIndexing FoldersFirst
      

      Click "Save and Close" followed by "Return to Global Configuration."

      In the top right-hand corner, there's an icon to refresh/restart, click that to restart Apache and have the changes take effect.

      Now, as long as you don't upload in index.html file, it should show a listing of files. If you upload an index file, it takes precedence and will prevent the listing.

      ...

      Keep in mind, this is a very basic setup to get you in the right direction :-). Webmin is a bit more complicated than most control panels as it's a bit heavier on the front end. This would take far less time if you did it from the CLI (command line interface) as you're not clicking around to multiple interfaces.

      • HUGE appreciation, THAT actually answers my question and my highest gratitude goes to you!

        My only lingering question is if since it is changing global configuration will it affect other sites? Like ftp.domain.com is what you just awesomely helped me out with but then I go create a server for domain#2.com will it fall under the same?

        Anyways again huge appreciation jtittle! You rock!

        • @SurfBlue714

          When you're only changing the file that pertains to the domain or sub-domain that you want to modify, it's not really modifying the global configuration. That part is a bit misleading on their end and should really be better labeled to prevent that kind of confusion (even I think it's misleading).

          The only truly global configuration files are going to be the ones that are config or apache specific (the first 10-15 files listed in the drop down) -- you can modify one VirtualHost without having an effect on any others (as long as what you change is correct -- otherwise it could bring down the site your modifying and all others).

          So, for example, you can modify sub.domain.com without affecting domain02.com (just as a very basic comparison). Just make sure they reside in two different directories.

          I like to keep mine separated by username and domain. For example, if my username was jtittle, I'd probably setup something like:

          /home/jtittle/domain01.com
          /home/jtittle/domain02.com
          /home/jtittle/sub01.domain01.com/
          

          etc.

          ...

          And, no problem at all :-). Always happy to help where I can!

          • Ah I see then, I found it hard to imagine it truly affecting others on a global level but as you said it is a bit misleading.

            In any case huge huge huge appreciation for all your help and assistance. I cannot understate how much you roxxorz my soxxorz! :-P

Have another answer? Share your knowledge.