arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MegaFuse Installation on Debian/Ubuntu
#1
Hello Post4VPS Community

Today I have been going through some older guides I have written and posted on FreeVPS.us because I wanted to put my NanoKVM VPS in use.

One guide I used was the "IPv4 reverse proxy for IPv6 only web hosting" tutorial to run a web server on the usual ports 80 and 443 while not having a dedicated IPv4 IP address but a full IPv6 prefix. And given that my NanoKVM VPS only has 10 GB disk space I decided to check this article I posted previously on FreeVPS to expand storage on my VPS somehow. Thanks to @deanhills for reposting this great tool here.

As can be seen in the reposted topic by @deanhills there are some open questions. This tutorial will address the installation process of MegaFuse on Debian or Ubuntu (thus also any Linux distribution that is based on one of the both). Unfortunately I cannot cover CentOS or other Linux distributions because I don't use them and don't have a server at hand to test it out. This guide can however be easily adopted to pretty much any other Linux distribution by finding out the corresponding packages names for the needed tools to compile MegaFuse.

Feel free to post your questions and feedback below. Let us begin now.


Use an account with administrative permission or sudo with a user that is allowed to perform sudo operations to peform the commands in this guide.


Prerequisite Installation

You need tools to compile the MegaFuse source code and build the executable file. MegaFuse is only available in the form of its source code. So the installation process is the compilation of this source code by hand. This requires compilation tools such as make, gcc, pkg-config and many others. Run the command below to install all necessary packages.
apt-get install build-essential make pkg-config wget zip unzip ca-certificates fuse -y


Prepare Source Code

After all the tools that you need are installed it is time to download the latest MegaFuse source and and extract it. That is also why the command in the first step included wget and both of the ZIP programs zip and unzip. This tools will help to download the source code and extract it.

Download the source code to your server:
wget https://github.com/matteoserva/MegaFuse/archive/master.zip

Extract the source code:
unzip master.zip

Go to the folder with the source code:
cd MegaFuse-master


Compile MegaFuse Source Code

Now as we have the extracted source code on the server it is time to compile it and build the executable file. To do that you have to run a single command in the folder with the source code (MegaFuse-master).
make

Depending on the performance of your server the compilation task might take a while. Just wait for it to complete. Once it is done your cursor will be back at the normal terminal. You can run the ls command and check if you now have the file "MegaFuse" inside the MegaFuse-master folder. If the file is there everything has worked out. If the file is not there check the compilation output for any errors. Feel free to post them here to get help with a solution to make it work.


Start MegaFuse

You are almost ready to go. First however you need to set correct permission on the MegaFuse executable file and after that you have to configure the MegaFuse configuration file with your MEGA account information and other settings. Please make sure you are still in the MegaFuse-master folder!

Set execute permission for MegaFUSE:
chmod +x MegaFuse

Configure MegaFUSE:
nano megafuse.conf

Inside the file uncomment the following entries:
- USERNAME
- PASSWORD
- MOUNTPOINT

Change the values for these entries. USERNAME is the username/e-mail address of your MEGA account and PASSWORD is of course your password. MOUNTPOINT is the folder where you want the content of your MEGA cloud to be mounted in. This folder has to exist on the server!

After you have adjusted all entries save the file and close the text editor. The configuration is basically done at this point. Now we can start MegaFUSE.

Start MegaFuse:
~/MegaFuse-master/MegaFuse -c ~/MegaFuse-master/megafuse.conf -f -o allow_other -o uid=1000

If MegaFuse started successfully you will see the message "MegaFuse is ready". Unfortunately MegaFuse has no service daemon, yet. So when you reboot your server you will have to run it manually and you will have to use tools like screen or tmux to run it constantly in the background.


You can now change directory to the mount point that you defined in the configuration file and run ls to see the content. You should see the contents of your MEGA cloud account. You can download files simply by copying them to a different folder. Uploading files is as easy as simply moving them to the mount point.

Be aware that due to how this remote mounted storage works there might be slight delay when downloading/uploading or changing files. A good Internet connection on the server will help quite a bit to combat as much delay as possible. File size of course also matters. The speed you work with is far away from the speed of a local disk.

That's it folks!


P.S. You can use the mount point together with a web server to serve the files you have over your page. Be warned: PHP and similar will NOT work! This can only be merely used to share files, download or view them. You cannot host applications on this mount point (I tried and it didn't work even after several attemtps and some research).

Demo: https://dl.pr0xy.eu.org/

If anyone is able to write a good systemd daemon script I will gladly share it here with (of course) the right amount of respect and credits.
[Image: zHHqO5Q.png]
#2
Nice tutorial. Smile

I would suggest to use rclone instead of megafuse though.

By using rclone, you are not limited to mount MEGA only, you can also mount Google drive, OneDrive, Yandex, Dropbox and many others, even WebDAV.

For systemd script, something like this should work: https://github.com/ncw/rclone/issues/2704


#3
I liked the tutorial.
I didn't get NanoKVM yet xD
Well done bro and thanks for this useful tutorial Heart



person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting