How to setup a standalone SFTP Server using Apache Mina - sftp

How to setup a standalone SFTP Server using Apache Mina? I don't want to take the overhead of writing and maintaining the client and server side codes. All I need is to deploy the Apache Mina SFTP server as a standalone application.
I could successfully setup the Apache Mina FTP Server as standalone. Here we can only setup servers based on FTP and FTPS protocols. But what I need is to setup a server using SFTP protocol.
I hope this can be achieved using the Apache Mina SSHD. I am able to create an SFTP server by using this java library but for this I need to write java code. I don't want to develop and maintain code since the use case I have is very common. I will be using this SFTP server to pick and drop files.
Can anyone help me to achieve it? If I am doing something wrong, please let me know. Also let me know if there is any other alternative.

Related

deploy war into NGINX

I need to host a java application on an NGINX server instead of on Tomcat7(current configuration), as the application is just a light-weight parser working as a data acquisition service for a sensor based device.
I know that deployment of war files is no-go on NGINX,so please suggest steps to port the application server from Tomcat7 to NGINX.
Jetty might be the option.
As far as I see it requires no code rewriting, just unpacking the .war file you already have.

VB.net and SFTP to download a file to a client

I'm working on an ASP.net web application that is written in VB.net
I need to download a file from the server that the web app is hosted on, to a UNIX client.
What is the best way for me to go about this?
I have a similar setup where i simply use the "wget" command. I also have another system where security is more of an issue, so I wrote a client program in C++ to connect with sockets.
Those are your two major avenues though... unless I'm missing requirements you haven't mentioned...

Can a .NET web application be host on dedicated linux server with static IP and run this web app as a web site?

I am working on a project which is a web based in which it has three different modules. For this whole project I am using a dedicated server with static IP which is a linux server with MySQL as a database.
Now my query is, in my project I am using a web and desktop application which connects to my server. Now my web application is integrated with my company website which is done in .NET
Is it possible to host my website in my dedicated server which is a linux version?
Could some one tell me which is the best way to run my whole project in a better way.
Thank you.
You can access a remote MySQL server instance from your .NET application, you need to ensure that any network routing and firewall rules let you through. You must ensure that the application server can reach the MySQL server on the 'listening' port (probably 3306).
Ideally you will have both the database server and application server in close proximity and on the same local network, otherwise there is no problem in this hosting architecture at all. Web applications and databases often require different tuning optimisations and for redundancy purposes it is also good practice to separate them out. Of course, you only have redundancy if you have more than one application server and more than one database server.

Can my asp.net application make a call to a linux server, speficially some shell script?

If I have a asp.net web app on a windows box (obviously!), and I need to execute a shell script that is on a linux server, is that possible?
How can I do this safely?
To build on what cxfx has said above your best bet might be to set up a web server on the linux box, and build a web service using, for example, php.
php allows you to run shell scripts - so by calling a web page runscript.php and then using exec (http://php.net/manual/en/function.exec.php) you could run the script.
Security is a consideration - you could restrict access to the linux web server purely to the IP address of the server hosting your asp.net site?
Hope that helps.
One way of doing it is by logging through ssh. You can use the granados C# library for it. This will let you run arbitrary commands. If what you need is to always run the same command, you can take a different approach like a CGI script (hide it with at least HTTPS and user/password).
Your best bet might be to expose the triggering of the shell script through some sort of web interface, like a secure web service.

Can I access ASP.NET Development server in an intranet?

Im testing an ASP.NEt site. When I execute it, it starts the ASP.NET Development Server and opens up a page.
Now I want to test it in the intranet I have.
Can I use this server or I need to configure IIS in this machine?
Do I need to configure something for it to work?
I've changed the localhost to the correct IP and I opened up the firewall.
Thanks
Yes you can! And you don't need IIS
Just use a simple Java TCP tunnel. Download this Java app & just tunnel the traffic back.
http://jcbserver.uwaterloo.ca/cs436/software/tgui/tcpTunnelGUI.shtml
In command prompt, you'd then run the java app like this... Let's assume you want external access on port 80 and your standard debug environment runs on port 1088...
java -jar tunnel.jar 80 localhost 1088
(Also answered here: Accessing asp. net development server external to VM)
No, you can't. It's set up so it only works on localhost, and I couldn't find any workarounds to make it work.
But, here's what I've been doing - I created the website on a specific port in IIS and opened that port up so it's visible on the network. I pointed that IIS website to my website's root folder (the one with web.config in it). Then I continued to use the ASP.NET Development server on that local machine while developing - both IIS and the ASP.NET Development Server can access the files at the same time (unless you're doing something wacky).
Let me know if there's a challenge with running IIS on your machine and I'll update my answer.
I realize this isn't a direct answer to your question, but an alternative to debugging using the ASP development server is to attach to the IIS process: How do I attach the debugger to IIS instead of ASP.NET Development Server?
Nope, stupidly (IMHO) there's no way to get the default ASP.net development server to serve pages to IPs other than localhost. What I did was to use UltiDev Cassini which is very quick to set up and is basically a version of the ASP.net development server compiled by UltiDev, and it will serve pages to any IP address.
Just for those who don't want/cant set up IIS for whatever reason...
Use fiddler or similar on your host - set your browser on the client VM to use the proxy then just use localhost:dev_port as usual on the client.
All requests from the client goto the proxy on your dev machine which routes to localhost on the dev machine and the ASP.net dev server thinks the request is from your dev machine!
You can recompile Cassini to get it to work - there's a fairly easy to remove check for localhost in there. Or, I'm pretty sure Ultidev's Cassini doesn't have this restriction. Both of these are easier to setup than IIS.
But, yeah, the builtin WebDev.WebServer doesn't work....Hmm, unless you run something like AnalogX's Proxy on your dev box and point it to the WebDev port. That should work (though I haven't tried it, it should take < 2 mins to setup).
You can use Cassini to expose your web apps externally. You just need to proxy the connection. I wrote a simple program to do this that you can run in another VS instance. Just change the port to match the port Cassini is using.
https://gist.github.com/945649
You can do port redirection using SOAP Toolkit 3.0
Once installed, go to My Programs > Microsoft Soap Toolkit 3 > Trace Utility
Once Trace Utility opened, go to File > New > Formatted Trace
In the dialog insert your ASP .NET Development Server port in Forward To Destination Port field.
It's only a workaround for testing purposes
I believe the built in ASP.NET server only works on localhost. You'll have to use IIS.
Compile all you website in Debug mode, then create the website and publish it in IIS (make sure you can view it from other machine). Then attach the VS2010 Debugger to the process with the AppPool of your website (the process is called w3wp.exe when IIS>v5 and aspnet_wp.exe when IIS<5).
If you make some changes, just replace the package contents on the physical path of the website, and there you go again.

Resources