file creation in linux - linux

I have created an application in which the android mobile takes picture and uploads it to a server. The server accepts the image, stores in local directory and updates the path to the database. Everything works fine on my localhost (Windows) but when i deploy the war file it is not creating the file. The problem is my localhost is on windows but the main server(ISP) is on Linux. Both my localhost and main server (ISP) are using glassfish. On the main server (ISP) I am logging through admin and then deploying the war file.

This might be your problem.
Where do you store your file in the server. In windows you might be giving the path as
D://images/dir1/......
In linux this path is not valid. It should look something like
/home/tomcat/images/repo/...........
Please post the code where you mention the location of the directory in which you store the images.

Related

Transferring files to IIS (attempted using PHPStorm & Finder)

I have a working local copy of a simple website I would like to deploy to an IIS (Internet Information Server) running on my local network. Running on my computer on MAMP, everything works perfectly. However, after I try to upload all the files to the web server and load the index.html it fails to GET many different files necessary to load the page. Here is an example error line in the console:
GET http://WEBSITE.com/scripts/bootstrap-wizard-custom.js 403 (Forbidden)
Here the methods I have tried to upload files to the live server:
Using CMD+K in Finder, connecting to the live server with an address like smb://webserver, and then simply dragging files from my local folder to the wwwroot folder.
Using PHPStorm (on Windows), selecting the mapped network folder as my workspace, and then "Deploying" all the files to the server by clicking an "Upload to [webserver]" button.
What is the best way to go about transferring these files from my local machine to a web server on the same network?
It turns out it was a permissions problem. After some permission changing, it now works. Fixed!

How do i get a direct download link for my file on Linux VPS

I have recently just got a subscription to a Linux VPS (Ubuntu)
I have logged into the VPS using FileZilla and uploaded my .png file to the VPS. But when i travel to the ip address in my web browser then i am unable to navigate to the directory for the file. I have apache2 running on the web server so when i navigate to the VPS using my browser it says this
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
Can someone please teach me on how to upload my .png file correctly so i can have a download link something similar to
http://myipaddress.com/home/files/mypicture.png
Would highly appreciate any knowledge applicable to my problem. If someone helps me solve the problem then i will happily tip them some cryptocurrency :)
You must put your public files in the directory published by the web server: the "DocumentRoot".
By example, it may be:
/var/www
The published files must also be readable by the Web Server process.
The Apache server on Debian runs with the "www-data" user/group, by default.

I am trying to link images to constant contact

I am trying to link images to constant contact from my linux server. The images are stored in a folder on my linux server as I have done previous on my windows server. The path I use from the windows server works fine but the path on the linux server does not.
I added the folders to the root of the drive and dropped the jpg's in the folder. So this is what works on the Windows Server http://www.mydomainname.com/folder/folder/image_name.jpg. This doesn't work on the linux server. Any help out there is very much appreciated.

Liferay migration from local to live site

I downloaded Liferay files from a livesite to setup a local environment for some local development. After downloading the files, I run the the catalina file (./catalina.sh start) But unfortunately I got a 404 error.
I'm not sure where to start in setting up Liferay locally.
I think there are some initial settings that I should be doing as I had moved from live server to a local machine.
I think I need to also connect my database. I now have a local copy of the database and is already imported on MySQL. I just need to connect them (im guessing entering my user and password for the database).
Other than downloading the files and starting up the server, I really haven't done anything else yet as I am not sure what setting and configuration I should be doing.
I'm new to Liferay, I apologize for my silliness.
Edit
my portal-ide.properties settings:
See portal-ext.properties or someelse *.properties file in the root folder of portal.
For error details, see the log file at liferay/tomcat/logs/catalina.out

How to deploy a data file on tomcat web server in linux debian OS

I have a web application developed using JSP and Servlet. This web application is deployed on server having Debian Linux as OS and The Tomcat version is 5.5.31. As this applications required some data files, These data files will be get created automatically when setting are done using a standalone java application. This application is deployed on another machine. This setup is done. As I dont know much about Debian Linux and where my application is goes on it so I have some doubts in deployment of these autimatically generated data files which are as follows
As I made the .war file of my web application and deployed it using Tomcat Manager. so I dont know where exactly my application goes. I dont know the exact path. How do I find it?
Is it possible to create FTP for this web application which is deployed on Debian Linux server? I think that if creating FTP is possible then I will directly connect to FTP using my Stand alone Java program and will easily do the creation of the file and other file and directory manipulation.
If you've deployed a war, the application isn't anywhere on the filesystem as such. Most servers will unpack the war somewhere, but you shouldn’t rely on where that is.
I can think of several options:
getServletContext().getAttribute("javax.servlet.context.tempdir") to get the application's temp directory, then inform you external program of this location and place the file somewhere in there in a know location.
Arrange for a "know location" outside of the application, such as /tmp/somewhere or /var/cache/your-app/somewhere to place such files. (Note: /tmp is usually cleaned on startup of a linux machine)
As for getting the file onto the server from a remote machine: You could get your client to upload the file directly to your webapp (something like Apache HTTPClient will help you there), which means that you could do without the "know location" above. If you want to do this outside of the application though, I'd avoid FTP (due to security). Instead, I'd go with scp (secure copy).
Edit: Reading between the lines a little, you mention "setting" in the data file. If this is a configuration file which is not changed once the app is running, you may find it more convenient to have a "deploy" step on your server which simply takes the settings file and adds it to the war before deploying it. This is easy enough with "ant war" for example. You could then access the file using getClass().getResourceStream(..) or such.

Resources