Meteor 503 from CollectionFS - meteor

I got a 503 when trying to upload using the CollectionFS Filesystem adaptor (only on production, local works fine.)
the response headers show:
Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Methods:PUT
Access-Control-Allow-Origin:http://meteor.local
I would like to know what this address is, but I could not find documentation about it.

Few thing that come to mind:
Your static files URL under the web server.
Do you set it to a virtual directory (location) on your web server?
If yes, check your nginx/apache virtual directory directives. Make sure there are correct
Do you handle it in your meteor application?
If you set it to your meteor application, did you set the route for it in your application correctly?
Permission issues between the user that run the web-server, the user that run the meteor application and the user that own the actual folder on the file system

Related

How can I change permission for an Azure Web App, so I can actually upload files via FTP to it?

How can I change permission for a Web App, so I can actually upload files via FTP to it?
What is it I need to change in order to have permissions to upload via FTP?
I have a running site that runs ASP.Net Core. Everything works.
For debugging purposes on a weird js issue, I need to be able to edit a few js files directly on the site via FTP.
When I connect via FTP (with the credentials from the "publish profile") I can connect just fine and download files - I use Filezilla.
But if I try to upload anything, I get "550 Access is denied."
I have full access to Azure Portal etc for the site, incl. Kudu.
It does not matter if you can upload files via KUDU or some other thing - I specifically need FTP.
Thanks for asking question! Could you please check if your firewall is blocked outgoing FTP writes.
Also, make sure you're not trying to write to a read-only file. For this suggest using the Kudu Console (https://[sitename].scm.azurewebsites.net/DebugConsole) to look at your files and check their permissions (e.g. using 'attrib' command).
For more information about KUDU, please refer to this document
Refer to this document link might be helpful: https://learn.microsoft.com/en-us/azure/app-service/deploy-ftp#get-ftp-connection-information
Try checking the ftp link which is provided by deployment center, For this Go to your web app, click Get publish profile, choose the Publish URL under tag <publishProfile profileName="your-webapp"

404 when trying to access web api

I have an application I'm deploying to azure.
It's a SPA app which uses REST API.
I placed the folder of the app in side the wwwroot folder.
when I try to access the API from my local machine i.e. my localhost:1979/api/auth/login
I can do it but after I place the files in the www folder - I get a 404
when trying to access:
domain.com/api/auth/login
I tried doing it on my machine on my local IIS and got the same error.
I'm sure it's a stupid thing like configuration but I can't figure it out.
Thanks for any help
Solved
Ok.
So I checked the issue on my local IIS and got the same problem.
The thing is, I created a directory inside an existing solution which have the web api + mvc.net and called the directory which contains the html i.e. mydomain.com/dist/index.html directly.
The solution was to send the html file via the controller so when a user comes in to the site, the home controller will send the html file and the ajax call from the JS file which was download from the html will succeed unlike getting the html directly.

Getting nginx 404 error on uploaded files

I am using PHP (5.3) to upload jpeg files, create folders for those files and store them. I have a development version and a live version both running on the same server (CentOS 7, Apache, Plesk 12).
On the live version, I am experiencing no problems, but on the dev version, the files are uploading successfully but I am getting nginx 404 errors when trying to access them through the browser.
If I try to access something which doesn't exist, I get a standard 404 error (not an nginx one).
When checking the access_log, I see a 200 code for the files.
Nothing in the error_log nor in the nginx error log.
No differences in PHP code, folder structure or configuration.
I recently changed servers and this is the first time I have attempted this upload on the dev system on this new server. Live version is used daily for this activity.
If I try to access older uploads on the dev server, they all work fine. It is only affecting new uploads.
Permissions and ownership are the same for both live and dev systems and old/new folders/files.
If I manually upload a jpeg to the folder, it also triggers an nginx 404 when accessed.
I have no experience with nginx so I am at a loss as to what I can try to resolve this issue.
It looks like you have upload and access files in one place but checking log in another place.
Are you sure you have no issues with domain name resolving?
Also it can be issue with virtual host - when you access file it overtaken by some other virtual host. It maybe default host for IP address.
I recommend you grep all system and vhost logs for file you have trying to access.

Add static file to meteor app while deployed on server

I want to add a set of static files to my meteor app; it's currently deployed to an nginx + ubuntu server as described here. When I simply add the static file to the app and execute restart appname, it doesn't work (the 404 page is displayed instead of the file), while files which were already deployed work fine.
However, when I re-build my entire app and restart the app on the server, the static files are served appropriately. Why? Does it have to be this hard?
Depending on whether or not you want your static files to be publicly available, you should do one of two things when setting up your application. Put assets only accessible by your application on the server and not accessible to the rest of the world within the private top-level directory in your application. Once these are bundled into your application, they will appear in the directory /program/server/assets. If you want files to be accessible to the world on the client, put them in the public top-level directory in your application. These files will be available from the top level of your website (www.example.com/examplefile.jpg).
As for whether or not you should rebuild your application when attempting to deploy new static files in your application, it is best to allow Meteor to properly bundle everything as necessary into the application rather than trying to add files to your application directly.
For additional information, please see the Meteor documentation here or check out this SO question/answer here.

ASP.NET WEB API 2 Works Locally But Not On Production Web Server

I've developed a new WEB API 2 that works great locally, however when I upload the same code to my production server (Arvixe in this case) all I get is a 404 when I call it. I've spent HOURS searching the web, reading forums, etc.. and have been able to find no resolution, so I'm asking here as my last effort.
I'm currently only testing with the default project that gets created when you do New Project > ASP.NET Web API 2 Empty Project in Visual Studio. This creates an empty project with a single ValuesController. You should be able the JSON response by called /api/values, but this doesn't even work.
I'm using Fiddler to test the API locally and on the web server.
http://localhost:1993/api/values <--- works great
but
http://api.mydomain.com/api/values <--- returns 404
Note: I created a subdomain "api" in this case, but everything for the code for the API is unchanged from when it was created.
Why in the world does this work locally but not on the production web server?
That the server returns 404 (Not Found) may indicate a lot of things. However you can check using the following step:
Add a simple text document like readme.txt to your a folder sub-domain http://api.mydomain.com, and try to get access to that. If you can't access to that file, it means that the subdomain is not configured properly.
Publish the webservice using the "Publish" functionality, so that all DLLs will be copied.
After that,try to reach the Web ApI again.
Hope that help.
"Note: I created a subdomain 'api' in this case, but everything for the code for the API is unchanged from when it was created."
Above comment of your's is suspicious, you should publish your WEB API application in the root directory. Like if http://example.com is pointing to "MyExample" folder, then application should be published on "MyExample" folder.
After that you will be able access your api with http://example.com/api/{controller}/{action}
Just a simple suggestion which I'm sure you have already considered, but have you opened the http port 80 on the server's firewall?
Also stick a plain old html file in the root of your project and see if the server serves it up.
in your case, since you create a subdomain of 'api', you should try
http://api.mydomain.com/api/api/values
note that if you're using database for the function, you should change the connectionString in your web config
Please verify the .net framework on you hosted domain that may be old one.
Web api 2 is supposed on 4.5 framework.
One reason for web api 2 method working OK on local machine but not on production server is that the method you are calling is working on local machine but not on remote server. In such a case you will receive message 404 or 500, and you would be lost why this routing is failing.
Why a method would fail on remote server, well there may be many reasons. For me, I was querying database in my method and my connectionString was not set for remote server.
One way of resolving it would be to put some very simple code in that particular method and test that routing is working. Then check your original code for errors reasons.

Resources