Java webapp to browse and access local file system - war

This is not really a programming question, except that the answer may be that I need to program it myself. We have a JBoss deployment, and we want to be able to access the filesystem of the server as the running jboss user with the web browser. Is there an off the shelf Java webapp (.war) that will allow this? I know of the security issues, this is an internal server.

Related

Access Azure Files Share from WebAppService

We are currently moving an old ASP.net web application from a hosted server IIS7 to Azure.
In the current setup the site is accessing a File Server using an UNC path to a shared folder on the file server.
\\file-server\files-client
We do, for now, not want to change this approach since it will substantially complicate the moving process.
We have set up an Azure Storage with File Service and a share in this called files-client
This can be access perfectly from a VM by setting up credentials and accessing it via
\\storageaccount.file.core.windows.net\files-client
But
We really would want to have this site run as a Web App Service since it gives us a number of advantages.
We have set up an App Service, have published the Web Application, and all is running great including DB access etc.
Unfortunately our luck runs out when the Web Application tries to access the file share using
\\storageaccount.file.core.windows.net\files-client\test.jpg
We get an access error:
Access to the path '\\storageaccount.file.core.windows.net\files-client\test.jpg' is denied.
This tells me that the App Service sees the share but is not authorized to access it.
I know that we somehow has to grant the App Service access to this storage, but searching the net intensively tells me that this cannot be done which I simply cannot understand, and hopefully I'm not looking in the right places.
Sp the question is: How do I set up the credentials in the App Service to have it access my Storage share?
Any guidance is much appreciated.
Thanks in advance
The App Service sandbox explicitly does not allow access to the ports necessary for SMB protocol (137/138/139/445).
This article mentions it under Restricted Outgoing Ports: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox.

Working with IIS on DMZ

Scenario
I have an application that I have been developing for two years. I use the framework .NET to develop it in a language called Oxygene that comes from Pascal.
When I have something new in my code, I publish my application in File System method. I have a couple servers working on Amazon EC2, so I transfer this files to a folder in my IIS Server. In this IIS Server I already have a website that corresponds to my application, so I just replace the old files for the newest files.
I have another server that works as an SQL server.
Last detail is that in my application the user is able to attach files, import pictures, export PDF and Excel files. Attachments and pictures are stored in the same folder the application is located.
Issue
Here is my problem. I have got a new client that is kind of a big client. It seems like this company has a strong IT security, so the application must be located in their servers.
The big problem is that they required my application to be set in the following architecture:
I am used to only use an app server (works for external access) and a SQL server. They want the third server in DMZ net so they can let external access happen. The reason the application can't be placed in the DMZ is because there are the files I mentioned bellow that the user stores in the application. The database stores all the data, but not those files mentioned.
Solutions I have offered, but won't be accepted:
Publishing the application in a IIS server located in the DMZ: That won't be accepted since my application stores user attachments in the same folder the application is located. There are also images stored there.
Publishing the application in the app server, but also publishing a empty application in the DMZ server redirecting to the IIS server inside the LAN: That's the best solution I have come up.
Using a reverse proxy to protect the LAN Net: This is off the table, since reverse proxy is not safe at all.
I am kind of confused because I can't see a way to separate my application in two to make it work in that suggested architecture.
Can anybody give me a hint or ideas of how this would work?
-
You can't "redirect" to inside the LAN, a redirect is a client-side operation, so if the internal server isn't already exposed, you can't redirect someone to it.
A reverse proxy is likely your best bet. Why do you believe it is not safe? This is a tried-and-true solution, it allows you to leave additional ports/services open to internal requests (like a file server, which it sounds like you are trying to expose).
How are these files getting uploaded? Are you using FTP? SMB? HTTP? This solution will not expose those other protocols to the outside world (please don't expose SMB to the outside, it will result in tragedy). Do the external users need to upload these files?

ASP.NET application to host on Java EE configured directory

One of our clients has a Java EE application. We would like to develop a new project using ASP.NET/C# by hosting the application as a sub directory under this Java EE project.
My questions are:
Will the .NET application run smoothly?
Do I need to keep anything in mind before I make a promise to the client?
The way you strucure your projects do not affect the behavior of your applications at all.
However in the end, each of the compiled and not compiled resources need to be configured propoerly to their proper Web Server, you shouldn't have any problem at all.
IIS has its own directory and Tomcat(or whatever you are using) will have its own directory.
Just let him understand that there is no sense on sharing the projects in a single root folder if the projects are not going to be related at all.
The only way to make them interact is by means of services and queues that you can orchestrate in any of both technologies.
UPDATE
let's suppose that:
you are using default of both web servers: your IIS need your applications to be copied to c:\inetpub folder whereas tomcat uses the $CATALINA_BASE system variable to locate their own folder. That won't be a problem at all.
Now, let's suppose that your client chose the same exact folder to be the root of your websites in tomcat and iis, (very bad maintenance decision by the way)
you could also separate both environments by having two folders : JAVA and DOTNET
Now let's suppose your client won't accept any logic suggestion, and you have to merge java files and aspx files, technically there won't be any issue because each web server will handle requests for very different issues, however, if you are also using the same resources, let's say a picture used in both pages, you will have locked-files issues, your iis can only respond for its own behavior and tomcat will only respond with its own behavior.
So in summary, technically speaking it could work, performance will be hit on your hard drive, it all depends on the request loads of each app, but overall it is a bad infrastructure design.
hope it helps,

How to make a webservice publicly accessible on the internet

I finally finish my web services, I have test with local host and in my network now what I'd like to do is send my web service to be uploaded to the internet.
I wrote my web service in C#, asp.net using the nodepad (and not using visual studio), also I use IIS for the localhost, so the files i have in my virtual directory are:
Web-Based Service Consumer: WebApp.aspx
FirstService.asmx
FirstService.cs
FirstService.dll
Now in localhost works great, but I have no idea of how to publish on the internet. Can someone explain or send a guideline, let me remember that i am not using Visual Studio (and dont want to, don't ask why).
The only thing I know is that I have to have a server working with IIS. Is this true?
Yes now you need to pay for an IIS hosting account to serve your files remotely for the world to see.
For example:
http://uk.godaddy.com/hosting/web-hosting.aspx
They will probably give you an FTP account where you can upload your files and some sort of web interface for you to configure the server. If you talk to them, I'm sure they can walk you through it.
Good luck.

Want to run my own server instance with special port for an ASP.Net 4 based solution

I have made an application in asp.net which sends and receive sms, it works very similar to desktop application and it will be installed on servers to send sms alerts, but the problem is if server does not have iis, it will not work. I have seen many apps which when installed, have their own server and port, you do not need to install any IIS, when you just double click it starts running on a special port and works well, similarly visual studio also runs its own port in development mod, so what is the best way to make such solution for an asp.net product.
If you're talking about how to host a service in an application outside IIS, Windows Communication Foundation (WCF), which allows you to host a service in a Windows Forms executable, Console Application, Windows service, or IIS.
It's too big a subject to explain fully here, but there's a nice starting point here.
This will allow you to create the host, and allow you to hose services similar to web services, but with more options for how to connect. (http, tcp, etc.)
But it's not an ASP.NET host. For that, you will need a web server that can execute ASP.NET, such as IIS. There's no way to get around the need to have a web server, whether it's one of the many already established, or if you write your own. I believe there are extensions for Apache that allow you to do so via Mono, but I've never used them. Writing your own would be, in my opinion, a waste of time and a bad idea.
The simplest solution by far is to specify that IIS instaled with the appropriate framework is a requirement for using your website.
Edit
However, if you REALY want to write a WinForms app and have it host ASP.NET, it looks like this previous question has an answer that would help. You can use the Cassini web server, the same one that Visual Studio uses.

Resources