How to open a HTML file on remote machine on local browser - html

I have written a simple HTML file on an EC2 instance. I want to check if it functions as desired. Is there a way I can open it on my local browser for testing?
EDIT: The output depends on some configurations which are present only on the remote machine!

You will need to install and start apache, placing the HTML vile in the www directory on the sever. Then open port 80 in your ec2 security group, but specify this rule to only be for the public IP of your home machine.

If its a HTML file you can open it directly from your desktop but if is a php file you need local server such as Xampp or wamp. If you want to edit it you can have a code editor such as notepad++ ect.. Hope this helps

If I understand you correctly. .. just open the file. It will run in your browser. It is just text. It is your browser that runs it.

Related

"localhost refused to connect" vscode html

<!DOCTYPE html>
<html>
<head></head>
<body>
<button>Hello</button>
</body>
</html>
Running this code from VSCode on my M1 Air yields either this:
..or a completely blank page.
What am I doing wrong? Was working, but then I accidentally clicked "run" on a .css file instead of my .html file, and it broke.
You can just open your .html file by double-clicking on it from your file browser.
Or if you want to serve it locally, you can use an extension like Live server. And then from your Editor, you can click on "Go Live"
Then this would show that your local server is running on a port like here it's 5500
Then the extension should open a new tab in your browser to http://127.0.0.1:5500/FILENAME.html.
If you don't want to use this VS Code extension, you can try other alternatives like browsersync.
localhost refused to connect.
is an error message that typically appears when there is a problem with the connection between Visual Studio Code (VSCode) and the localhost server. This can happen for a number of reasons, but some common causes include:
The localhost server is not running or is not configured properly.
There is a problem with the network connection, such as a firewall blocking the connection.
There is an issue with the code or configuration of the HTML file in VSCode.
To troubleshoot this issue, you can try the following steps:
Check that the localhost server is running and configured correctly.
Check your network connection and ensure that any firewalls or antivirus software are not blocking the connection.
Check your HTML code and configuration in VSCode to ensure that there are no syntax errors or other issues that might be causing the problem.
Make sure that the chrome browser is in the updated version.
Check the port number if it is configured correctly in your code, if not change it to the correct port number.
Open your .html file by double-clicking on it from your file browser or right click context menu and then open with option, choose a browser option.
Use Live Server VS Code Extension or BrowserSync Extenstion.
If the problem persists, you can also try running the HTML file in a different browser or using a different localhost server to see if that resolves the issue.

How can I force Chrome to open index.html file while browsing a local directory?

I am trying to implement an internal website on my company's shared hard drive.
Everything is going well except that I would like Chrome to open index.html file by default on root folder, exactly how it would do it on a remote web server. Any ideas, folks ?
What we do have as for now :
You have to run a webserver. By default, chrome will not serve any file, you have to open them on chrome properly.
So, since you're using WordPress, I suggest you to run xampp, or anything similar. To run on internal local network you have to configure windows to allow incoming connections from your machine IP address

Hosting web app on xampp

*I hav made a small demo web app(using html5, and jquery mobile)
*I have installed and set up Xampp
*set passwords for local server
* I am confused as in what to do next, where do i store my .html files and other resources
*I need to test my app on a network
*I want to set up a database using xampp ,(i have no idea how to)
*edit: since its a mobile web app, i want to test it from my mobile, is it possible by hosting it on my pc ? If yes, then how?
If you have the apache server running on xampp, you have to put the files in the /htdocs map. This is usually located in something like C:/xampp/htdocs. Then you go to your localhost in your browsers, so localhost and then /example.html.
This would be for example localhost/example.html, this would redirect to the example.html file in the htdocs folder.
Then if you want to set up an mySQL database you should take a look around at localhost/phpmyadmin

How can I have apache load and display folders stored in a shared folder on another machine?

I am running an apache server on computer A. I use computer B with ubuntu desktop and A lamp server to develop code because it's more portable. I use ftp to put html files on computer A and they can be opened by connecting to computer A's ip via the browser, all simple enough. Now I would like via a link on my default page index.html to be redirected to an html file stored in a shared folder on computer B. Is such a thing possible and if so how can I make apache render the html page at such a location as smb://<network location>/var/www?
mkdir /var/www/remote # assuming your current document root is /var/www/
mount smb://network.host/var/www /var/www/remote/
Once you have it working you can edit /etc/fstab to make it permanent, or script step 2.
This will keep your current local server working, and allow you to access the remote path at http://127.0.0.1/remote/

Php Storm remote files editing

I am new to PhpStorm. I want to edit files on remote host without mapping (like in PhpDesigner). I configured server, opened in on Remote Host window and I watch all files, but when I click on file it is not open in editor. How to do this?
In new EAP version of PHPStorm You can edit remote file. http://blog.jetbrains.com/phpstorm/2015/04/remote-edit-in-phpstorm-9-eap/
You can only edit local files. This is a lacking in IntelliJ platform IDEs. Sorry for this. You can take a look at this ticket, or make one for yourself as a feature request.