How deploy .htm extension on a server? - html

I want to learn AngularJs from http://www.tutorialspoint.com/angularjs
but an example must be deployed a server. I don't know anything about it.
Please give me some hint about deploy .htm extension file to a server.
Example url is following;
http://www.tutorialspoint.com/angularjs/angularjs_includes.htm

I believe that they just mean placing the files somewhere inside the web root. The web root should be deployed by your local or remote server.
Example:
Download and install MAMP.
Set your root directory as the MAMP root directory in preferences.
Now you can use your own paths -- just follow the example in the link you provided.
https://www.mamp.info/en/
Also, I'm of the opinion that it's good practice to at least use a local web server as opposed to running your website without one.

You don't need a webserver to test the code given in that example. ng-include using relative paths works fine.
However, if you really want to use a webserver for other examples/projects, depending upon your OS, you can use *AMP. where * means
W for windows
L for linux
once you have it installed, place the files in www folder. and access it in browser using http://localhost

Firstly I add my app folder under
D:\tomcat7\apache-tomcat-7.0.67-windows-x64\apache-tomcat-7.0.67\webapps
after I run tomcat server .
And run
http://localhost:8080/an/ht.htm
It is working :) Thanks #ketchupisred #Mridul Kashyap

Related

local host refused to connect; this site can’t be reached

I’m a beginner and I’m using VS Code for coding. I’m learning HTML and CSS. When I debug the code on Chrome I see the following:
This site can’t be reached. localhost refused to connect.
Please, I need help to solve this problem, hope I get the help soon. Thank you!
Try Live Server Extension AND check for Firewall Settings
This problem is either because you didn't run anything to serve up the files or a firewall issue. If it's a firewall problem then check your firewall settings for anything that would block it, but most likely you need something to serve up your files. There are a number of ways you can serve the files
Option 1
Use the Live Server extension. In VS Code you can search for it and install it, then with a click of the "Go Live" button on the toolbar, it will serve your files on localhost and open the browser for you.
Option 2
Use http-server, which will serve up your files with a simple command line command.
Option 3
Use Node.JS to serve up your files. It's a very popular technology, but is more complicated compared to the first 2 options if you just want to fiddle with beginner JavaScript, you may need to add a start script.
-- OR -- just open the file with your web browser. You can double click on file you want to open from File Explorer or right-click >open with browser of your choice, in which case you don't need to run a background software to serve your files and you can use the browser UI and console for testing. In this case you just wouldn't have VS Code available to use with it's debugging tools.
Alternatively, you can try using Python's SimpleHTTPServer if you have Python on your system.
1- from xampp window select httpd.config and search about Listen make it Listen 80 , search about localhost make it ServerName localhost:80
2- from xampp window select httpd-ssl.config search about Listen make it Listen 443 , search about VirtualHost _default .. make it VirtualHost default:443 , i did that and localhost worked normally

Set absolute path for root directory in HTML on local filesystem

How can I use absolute paths in my website while testing on my local filesystem? I know that I can use / to access the root directory of my website. However, this works only when my website is on the server. I want to be able to use absolute paths on my local filesystem so that I can do proper testing before uploading.
Is there a way to set a variable to a root directory in HTML? Something similar to Linux where you can define a variable WEBPATH=/home/user/website. Thus I can use e.g src="WEBPATH/folder/file.html for all the files I use in my website and I can modify WEBPATH depending on whether I am testing locally or using the server root folder.
I am open to other workarounds as well.
I'm assuming you're using a file url to access your HTML in the browser, in which case an easy way to get absolute paths working is by using a local webserver to serve your site.
If you have Python 3 installed, you can run python3 -m http.server from the command line at your web root, and it will serve your site at localhost:8000.

For PyCharm/WebStorm my IDE's local server is not detecting other directories

When I select a html file to open "in browser" in Webstorm it works and it opens under the localhost. The issue I'm having is that this webstorm internal server is not detecting any of the other paths in my project root like images and javascript files.
I should note that this feature has worked before on other projects I started from scratch using "new project." The difference with this project is that I opened a directory as a project.
The built-in webserver serves files from http://localhost:<built-in server port>/<project root>. Forward slashes in URLs tell the browser to resolve them relative to the web server root (localhost:63342 in your case), causing 404 errors.
If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559.

MAMP htdocs phpinfo

I am trying to get a simple phpinfo() to print out on my local server (using MAMP). I made a new directory in /Applications/MAMP/htdocs (php_sandbox) and put a file in there named my_phpinfo with only phpinfo() in it. How can I view the contents of this file in my web browser?
Is it also advisable if I set the Apache document root to be in my home directory/sites? I will be mainly using this local server to test/host some small sites.
Thanks!
visit in your browser localhost/my_phpinfo/index.php assuming you named the file with
<? phpinfo();?> is in index.php. Also, make sure you are editing the correct php.ini in your MAMP directory by checking your mamp prefs and seeing what version of php MAMP is using.
Your in the right folder by default from what I remember. MAMP runs apache on port 8888 by default. You should be able to go to http://localhost:8888/ You can also get to this page via the control panel (should have a button to open home page). This page will also show you've configured MAMP's Apache to run on a different port.
Whatever you name your file; you'll want to give it a .php extension, so if you file is named my_phpinfo, add a .php so it becomes my_phpinfo.php. Make sure you function called is wrapped in php tags like so
<?php phpinfo(); ?>
If this file is directory in the htdocs folder you should be able to go to http://localhost:8888/my_phpinfo.php and get the PHP Info page.
As far is moving the directory. I normally do. Especially b/c it makes upgrading MAMP a little easier (already have to worry about MySQL). You might have to tweak the file permissions just a bit to make sure it runs correctly. I believe though you should be okay since it is running as your User.

Tricking IIS 6.0 html web site into thinking it's at the root

I have no idea how to search for this one and perhaps Serverfault would be better but I'll start here.
I have a HTML web site running at the root of one of my webservers. It runs fine and dandy. I needed to make a test environment for it and where I can't run it in the root of the websever. I have to make a directory on the test server. For instance:
http://myTestserver/HtmlWebsite/index.html instead http://myProdserver/index.html
Once I throw it into the directory, most everything breaks. Some images won't load, javascript files can't be found, mass hysteria!
I discovered that the author of said site had used a mix of absolute and relative directory paths in all the files hence why some images loaded correctly.
I can go in and edit all the files to be relative. But I'm wondering if I can make IIS 6.0 think that the web app directory it is in is the root of the webserver. So if I have an absolute path in the HTML like:
<img src="/_support/loadme.jpg" />
it would give me the image for either http://myTestserver/HtmlWebsite/_support/loadme.jpg or http://myProdserver/_support/loadme.jpg.
Can I get IIS 6.0 to do my bidding or am I stuck editing paths?
Unfortunately you'll either have to fix the absolute URL's across the site or run the site in it's own website in the root.
Is there no way you can get a new site created on the IIS6 test server?
You should be able to by using URL rewriting
First you install ISAPI Rewrite, found here: http://www.helicontech.com/isapi_rewrite/
Then you create a config with the following rule:
RewriteEngine on
RewriteRule (.+) /HtmlWebsite$1
What it does is it takes your request, say /index.html, and internally rewrites it to /HtmlWebsite/index.html, which is (ironically) tricking you into thinking you're calling from root when in fact it fetches it from the subfolder.
You might have to add or change the rule if you got more stuff on your test server, but that's the gist of it.