B4J Question B4J FTP server running on Linux

TomDuncan

Active Member
Licensed User
Longtime User
Hi all,
I am using the FTPServer as a test (no mods) works fine on Windows.
changed
B4X:
server.BaseDir = File.DirApp &  "/webcams" '"c:\temp"
and all still worked.
Then transferred this Compiled jar over to a Linux machine.
Filezilla connects ok on windows
BUT on Linux Logs in OK, Name and Password ok.
But will not get directory listing.
Have tried changing this to "/home/tom/Documents/files"
this is the Filezilla report.

B4X:
Status:    Disconnected from server
Status:    Connecting to 10.1.1.55:51041...
Status:    Connection established, waiting for welcome message...
Status:    Insecure server, it does not support FTP over TLS.
Status:    Server does not support non-ASCII characters.
Status:    Logged in
Status:    Retrieving directory listing...

and

B4X:
Command:    TYPE I
Response:    200
Command:    PASV
Response:    227 10,1,1,55,199,98
Command:    LIST
Response:    150
Error:    Connection timed out after 20 seconds of inactivity
Error:    Failed to retrieve directory listing

I am running the Server with sudo as well.

Any thoughts on why the base address seems to be blank and why it wont work.
Tom
 

Harris

Expert
Licensed User
Longtime User
Hey Tom,

What does your dir structure look like on the Linux machine - off the var/ directory I mean to your app and supporting folders.

I had a similar issue and required a "../" or something else pre-pending (or suffixing) the path depending on the component I was using.

Linux is slightly different from windows but can be programaticaly controlled.

Thanks
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
I am running from my home directory not through var and www etc.
so I use "/home/tom/Documents/files" but will test.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
OK, your default linux may impose a different dir as the root.... Which you can change thru configs...

Now that we know what you are doing, others may pipe in here that are experts in this matter - without me having to research how to resolve this issue needlessly.
I have dealt with this in the past - but my dementia and alzheimer inhibit me to recall how... (you know what I mean - too much info - so little grey matter).

Thanks
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Depending on the linux version - the root dir will be different. I use Ubuntu 14.04. What are you using?

Search Linux Root Paths depending on version... This screwed me up until I found out why - new versions of Linux changed root dir...
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
This raises the issue of Windows servers vrs LinuxServers.

I have several Linux servers where I have not have to re-boot (clean) in years...!!! - and they are FREE.

I have one production server, running at a client's site, where it needs a re-boot every three months - or it hangs....
It is a modern WIN server running their latest (expensive) server software.

Go figure...
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Running Lixux servers does however require you know how to setup, update and manage them.
I figured this out and so can you. It all depends on what you need to support - like FTP (email / MySQL).

Most updates / upgrades are done using cmd commands - using SSL into your server.
I found these using Google searchs and copy/paste (press enter) to invoke the process.

Spent many hours with this but in the long run, it was worth a stable Linux server...

Good Luck!
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
My Server works well for my noip sites https://ctd.noip.me
Running on Apache.
A new one for a friend (i.e. free) is that we get ipcamera images from around the district. These are sent via FTP and email to a b4J collector of info, which then creates thumbnails etc from the cameras and puts then in the correct location.
With typesetterCMS I then build the site with nice images youtube clips and facts.
Fun
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Again, under Linux, you need to know where / what the dir is where these are stored.
Linux forces the root dir (which you can change) and all else paths off of that...

After you discover this requirement, you shall progress with ease on future projects using Linux.
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
I am still lost (I am an old f..t) I have the FTPServer (B4J version) in my home folder
I have now created a folder in my /var/www/html/files (this works with a http server that I have tested)
I then
B4X:
server.BaseDir = "/var/www/html/files"
Does not work. Cannot find how linux creates it's file structure.
I am just going using the command line and File manager GUI

Tom
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
https://serverfault.com/questions/625261/root-directory-var-www-html-apach2-on-ubuntu-14-04

Frustrating isn't it?
Where the hell do you point what - where - when?

I have found it is all trial and error with different Linux versions. Newer versions changed root dir to var/html - which I see you have properly referenced. Screwed me up several times in the past.

Until someone else pipes up (who knows how to address this without assumptions) , we are experimenting until it works...

It will be clear as mud then.
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
Installed FileZilla on the Linux box. Same result in not finding folder. Will do more checks in the morning. Will also try port 21
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
Did try and get bridge going but did not work. Will check that out also.
This is on two Linux lite builds, one 64 bit the other for testing is a 32 bit version.
 
Upvote 0

TomDuncan

Active Member
Licensed User
Longtime User
On the Linux machine I am running a b4j web server and mail server. That is going well. Do I need any more java on that machine to run b4j bridge?
 
Upvote 0
Top