Cannot GET /foldername - javascript

I am trying to access following url in my browser, but it throw error "can not get/foldername"
http://lineup.fezzee.com:8080/json/
Although when i access file in this folder, it works
I have given 777 folder permission
What i want is that when I hit http://lineup.fezzee.com:8080/json/ it will display all files in browser
I am using Ubuntu server
Thanks in advance

Related

Assets not fetched on cpanel server

I'm trying to work on cpanel before hosting my own website. And I'm very much new to this. After uploading my files on cpanel, I am getting the error and the assets folder is not read & my css & js files are not found. On localhost everything is working fine but on cpanel its not working.
I keep getting this error net::ERR_NAME_NOT_RESOLVED.
I tired looking for a solution, but most of them were regarding localhost, but the files are working on my localhost but not on cpanel.
Can anybody help me please.
Console errors:
Network JS headers:
I figured it out, the problem was the domain name, which direct the http request to the assets folder, but here I was using a free domain name that i got from infinityfree. And when i tried running the same link on a different cpanel with purchased domain name, it's loads up just fine.

For the ajax url shows 404 on the AWS tomcat log

I was using MVN install deploy my code on the AWS tomcat. I did this by directly open the AWSname:8080/manager/html and upload the WAR file(I am not sure if it is the correct way). The server can load the index.html successfully as my expectation and shows page on the front-end, but error went to call AJAX, which is in Javascript file, it always return 404. The servlet's url pattern will be like this
AJAX
Login Servlet
I tested everything fine on my localhost:8080, but in the AWS tomcat, the log showed like this.
Tomcat Log
I've never met such a case before, could somebody give me some useful suggestions on the possible solutions?
from your description it is not clear if you have multiple apps/war/containers/servers.
From your message you have a UI, which seems not to be bundled into your war file. To check in this case use these steps to check your setups
Add a index.html to your root in the war file and test if you can access it locally.
if this works, deploy on AWS and try to access the same path on AWS.
if the page is showing, your context is defined well on AWS. So you have an issue with your URL mappings
But if it does not show, you have a URL problem (wrong URL on AWS)

Failed to open dir on server

In localhost I can delete, copy my folder and files just fine. However, after I host my web app, those functions don't work on the server.
Here is the error that I got:
Uncaught exception 'UnexpectedValueException'
with message 'RecursiveDirectoryIterator
::__construct(/home/solution/public_html/portalprojectcdr/backend/web/The Library/ISU/New directory) : failed to open dir: No such file or
directory' in /home/solution/public_html/portal/backend/views/site
/submit_upload_to_server.php:73
As there seems to be a new directory involved in your error, i suppose you should check permission and owners for your files.
Please mass downvote if this advice in unsecure, but i use it on production :
Define the user www-data as owner of the file and folder that must be writable.
If you are not on production, you can try a naughty chmod 777 where needed, to see if your problem is really permission related.
Don't forget to put permission back to normal after your test.

Forbidden : You don't have permission to access /questions.php on this server

I am beginner in PHP and I got the Error for Developed My Project ERROR is Like:
This: Forbidden
You don't have permission to access /quiz.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Please give the suggestion for Solve this problem.
From interpreting the error, I believe that the problem doesn't lie in php but rather in the underlying operating system and filesystem. More specifically, file permissions.
If you are running Apache on Linux the webserver will only be able to serve pages that it can read. This has to do with local filesystem permissions.
I'm taking a leap here, but if your server is run by the user www-data then that user needs read permissions to the .php files in order to serve them as web pages. If these files are in a subdirectory, then that subdirectory and the .php files inside must also be accessible by www-data.
First, make sure that quiz.php is readable by the user www-data, as most likely you would have created this file using a different user account (root? yourself?).
The following command sets the owner of the file quiz.php to www-data
chown www-data quiz.php
This command needs to be issued in the directory where quiz.php is located and it needs to be entered with a user account that has sufficient privileges to change a file's attributes. Normally this is the root account, but it could be you if the server's administrator has given you those permissions.
You can read up on the chown command by typing
man chown
on most Linux systems.

How to give relative path in .js on linux platform?

I have Web UI developed in simple HTML and .js with lighttpd as web server and it is on linux based device.
I need to keep my main.html file in root directory and javascript files in js folder.
While running program it reads the javascript from js folder and the javascript accessing config files from other directories (/etc/config/myconfig). While accessing this file application giving error as 403 since I am using XMLHttpRequest, but it works when I keep myconfig file in root directory i.e with the main.html.
Please suggest is there any way to tell javascript to read file from /etc/config directory.
Error 403 :
403 Forbidden
The request was a valid request, but the server is refusing to respond to it.[2] Unlike a 401 Unauthorized response, authenticating will make no difference.[2] On servers where authentication is required, this commonly means that the provided credentials were successfully authenticated but that the credentials still do not grant the client permission to access the resource (e.g., a recognized user attempting to access restricted content).
You need give your script access to read from the directory(/etc/config).
Read about chmod/chown commands.

Categories