I have the following folder structure:
C:\xampp\htdocs\project
Inside project folder, I have an index.html file and other folders which contain js files and minified versions of angular and angular-route.
I installed XAMPP and I started all the modules(MySQL, FileZilla, Mercury, Tomcat), only Apache doesn't start, throwind these messages:
5:14:15 PM [Apache] Status change detected: stopped
5:14:15 PM [Apache] Error: Apache shutdown unexpectedly.
5:14:15 PM [Apache] This may be due to a blocked port, missing dependencies,
5:14:15 PM [Apache] improper privileges, a crash, or a shutdown by another method.
5:14:15 PM [Apache] Press the Logs button to view error logs and check
5:14:15 PM [Apache] the Windows Event Viewer for more clues
5:14:15 PM [Apache] If you need more help, copy and post this
5:14:15 PM [Apache] entire log window on the forums
I'm trying to see the index.html file in a browser, I use this URL: http://localhost/xampp/htdocs/project/index.html but I get an empty page, in console showing this message:
GET http://localhost/xampp/htdocs/project/index.html 404 (Not Found)
Any ideas how to solve this?
The URL you are trying to navigate to is not correct. It should be localhost/project/index.html#/. Basically, xampp sets up a server (apache and others) in your system. And your file for a project such as index.html should reside in the xampp\htdocs\YourFolderName.
The browser locates the server in localhost and will search through the above folder for any resources available in there. So the url will for above case will be localhost/YourFolderName/index.html#/
Related
My team is building a web application using Jquery. We are coding it with Visual Studio Code and running locally using npm's http-server.
I am trying to publish the application on a local IIS server to demo to our management team. I created a new site on IIS (for this topic, I'll call it "MyWebApplication"). I copied our code to the MyWebApplication folder under wwwroot. Our application, however, is not displaying properly from the server--it only displays some of the text, but the menu we created in JavaScript is not showing up.
Looking at the Network tab in the Chrome debugger, I do have an error:
GET http://{iisserver}/scripts/menudata.js?_=1524242509037 404 (Not Found)
The initiator is jquery-3.2.1.min.js:4.
Notice it's looking for the script in the root, http://{iisserver}/scripts/..., not in http://{iisserver}/MyWebApplication/scripts/....
If I expand the scripts folder on the Sources tab of Chrome's debugger, menudata.js and one other script related to our menu are not listed. All other .js files in the folder are.
The menu does show up if I copy my scripts folder from MyWebApplication directly to the wwwroot folder, but I shouldn't have to do that.
Are there any ideas on what I can do to make this script accessible from my IIS?
This is IIS 7.5 on Windows Server 2008 R2.
Edit:
This is a 404 log entry from the IIS log:
2018-04-23 14:29:16 x.x.x.x GET /scripts/menudata.js _=1524493754277 80 - x.x.x.x Mozilla/5.0+(Windows+NT+6.1;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/65.0.3325.181+Safari/537.36 404 0 2 187
I'm using Eclipse 4.5 and I've installed Webclipse 2015 CI 8 and Tomcat 8.0. I'm trying to debug an example. But the debugger doesn't stop at a breakpoint. It runs through the whole file and shows
Uncaught TypeError: $(...)[methodToCall] is not a function
at doExceptions (http://localhost:8080/Webclipse-JSDebug-WebApp-Example/:180:42)
at (http://localhost:8080/Webclipse-JSDebug-WebApp-Example/:181:6)
Failed to load resource: the server responded with a status of 404 (Not Found)
Uncaught TypeError: $(...)[methodToCall] is not a function
at doExceptions (http://localhost:8080/Webclipse-JSDebug-WebApp-Example/:180:42)
at (http://localhost:8080/Webclipse-JSDebug-WebApp-Example/:181:6)
What did I do wrong?
I've installed Webclipse 2016 and I've got the same problem. Anybody knows why?
I'm not positive about the exceptions, however, a possible reason for skipping the breakpoints would be if you right clicked the project and chose debug as -> debug on server. Instead, select debug as -> JavaScript in JavaEE Web Application. This should start the server and open the application in chrome, pausing at the breakpoints.
So basically, I have the following situation going on: I have a nodejs server running on port 80 and an apache server on port 8080 (the apache server is used for executing php files to a mysql database).
Everything is working fine, unless the nodejs server is down. The client can't get the main index.html file (or any file for that matter) , and therefore can't execute code which includes catching an ERR_CONNECTION_REFUSED error, thrown by the client. When the server is down, I would like to reroute the client to a page with the port :8080 behind the url, where the users can see that the server is down.
My question is how do I do this?
Thank you very kindly,
Zeno
EDIT: apache error:
[Sat May 23 22:09:46.096365 2015] [ssl:warn] [pid 5020:tid 324] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat May 23 22:09:46.112376 2015] [proxy_html:notice] [pid 5020:tid 324] AH01425: I18n support in mod_proxy_html requires mod_xml2enc. Without it, non-ASCII characters in proxied pages are likely to display incorrectly.
[Sat May 23 22:09:46.189482 2015] [core:warn] [pid 5020:tid 324] AH00098: pid file D:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat May 23 22:09:46.195484 2015] [proxy_balancer:emerg] [pid 5020:tid 324] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??
[Sat May 23 22:09:46.195484 2015] [:emerg] [pid 5020:tid 324] AH00020: Configuration Failed, exiting
You should be able to specify a fallback resource in cases where one resource is not available:
FallbackResource /index.php
This can be placed in an .htaccess file or within your apache config.
https://www.adayinthelifeof.nl/2012/01/21/apaches-fallbackresource-your-new-htaccess-command/
To handle the node server being down, you would need to have setup a reverse proxy server using apache or nginx. Then you can specify a fallback resource in case the place your proxy points to is down.
This is how to setup a reverse proxy in apache with fallback via balancer.
https://serverfault.com/q/87507/193671
I have facing strange problem. I have deployed images and js file in Apache Tomcat directrory but it is not showing on page and a warning is coming up:
Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:8084/webApp/img/access.jpg".
Earlier it was working fine but now jquery is also not working and the following error is coming up:
Uncaught ReferenceError: jQuery is not defined
Earlier this error message was appearing in Firefox but Chrome was working fine. But now it is showing the error in Chrome as well.
I have also tried to use the absolute path but no success.
<script src="/webApp/jquery-1.7.2.min.js"></script>
<img src="http://localhost:8084/webApp/img/access.jpg"/>
If you are using tomcat, you should locate the resources at $CATALINA_HOME/webapps/ROOT folder. From there, you might have access to the files.
You can check the access permissions from terminal. If you use unix / linux, locate to the folder:
cd $CATALINA_HOME/webapps/ROOT
And execute the command:
ls -la
This means it can be accessed by everyone, so should be available to everyone accessing to the server by browser
drwxr-x**r-x#** 22 user staff 704 11 jun 01:25 .
You could also try changing the permisions, but your server would be unsure:
sudo chmod a+rx webApp/img/access.jpg
Or go to the webApp folder via cd and execute
sudo chmod -R a+rx .
Deppending on your preferences (the last one means giving permission to all resources on webApp folder, what means givving access to all your projects in server, quite unsure...).
Hope it helps somebody.
Trying to use design.io with node.js Express to get css/javascript hot-push into browsers,
I cloned the example https://github.com/viatropos/design.io-example
and couldn't get it to hot deploy after
following instructions in https://github.com/viatropos/design.io-example/README.md
shell-1-project-dir> design.io --watch ./src
error: unknown option `--watch'
following the instruction on https://github.com/viatropos/design.io/README.md
shell-1-project-dir> design.io start
shell-2-project-dir> design.io watch
[Sun, 06 May 2012 03:52:04 GMT] INFO updated views/.index.jade.swp
[Sun, 06 May 2012 03:52:04 GMT] INFO updated views/index.jade
[Sun, 06 May 2012 04:03:11 GMT] INFO updated views/.index.jade.swp
[Sun, 06 May 2012 04:03:11 GMT] INFO updated views/index.jade
Doing this, I can't access the http://localhost:4181/ because node.js isn't started. I have to start node.js instead.
shell-1-project-dir> node server.js
However this doesn't hot-push the changed index.jade file.
Seems like the example is outdated?
How do I hot deploy ?
Env:
OSX-LION
node 0.6.15
First, you can have your node server running in a different terminal window (you don't need to run either the design.io server or the node server, you can run both at the same time as long as they are on different ports).
Second, I don't think this does what you want it to. Design.io seems to be for injecting changes made to static client files like stylesheets and javascript files. You change a .css file, design.io sees the change and broadcasts it to the browser, design.io in the browser forces a stylesheet reload, completing the hot push of the change.
Jade files are a different story, they need to be processed by an interpreter before being sent to the browser (browsers don't understand jade files). Design.io will see the change but can't do anything about it since Node.js needs to process the new file and send an updated response to the browser. The only way it does this is if you refresh the browser page (thereby sending a new request) which is not really a hot swap.