22.1 C
New York
Tuesday, June 2, 2026

webserver – Utilizing Apache for native recordsdata


Browsers learn a URL (Uniform Useful resource Locators) to inform them what to open.

It is a string that begins with a scheme after which a :. Examples of this are http:, https:, file:

You’ll be able to see the scheme that the present web page you’re looking at within the tackle subject of your browser if you happen to click on on the tackle.

Should you click on on the file in Finder or use open and a file title the browser might be given a URL with a scheme of file: . This tells the browser to learn the file on the tackle given.

If you wish to learn by way of Apache you are attempting to make use of an online server. Apache will present pages usually utilizing the http scheme. I neglect what the precise default setup of Apache is however assume it reads recordsdata from ~/Public/Websites and you’ve got a file check.html in there. To entry that file you will want to make use of a URL of kind http://ip-address/location
For a neighborhood Apache server the ip-address might be 127.0.0.1 or utilizing DNS localhost or it’s also possible to use the ip of your machine in your native tackle or utilizing bonjour machine-name.native
So to learn your file it will be http://localhost/~username/check.html The ~ is assuming you might have setup Apache to map a username to ~/Public/websites.

There are lots of different methods to configure Apache so that you MUST learn the setup directions to create the configuration. This would come with telling Apache the place to learn recordsdata from, whether or not it ought to use safe http (which you must do if anybody is utilizing the server from one other machine.

The configuration additionally maps what’s a part of the URL after http://ip-address/ onto easy methods to cope with CGI/PHP and so on.

man http will begin you on what to do, nonetheless I believe it’s probalby higher to make use of one thing aside from the default Apple supplied Apache.

Related Articles

Latest Articles