To understand the client side better, let's make a simple web page containing some basic information about our map. First of all, we need to get our web server's root directory. As web servers can only see a portion of the filesystem, they can only serve our documents if they are placed in the portion they can use. Apache comes with a default web page, which can help us locate this root folder without searching for configuration files. If we open http://localhost in a browser, we can see the greeting document we are searching for. The document's name in the filesystem is index with a varying extension (for example, html, html.en, and phtml).
The location of the web server's root folder can vary between different operating systems, versions, and distributions.
- On most Linux distributions, the web server's root folder is located somewhere in /var/www. On Red-Hat-based distributions (for example, Fedora, CentOS), it is in /var/www/httpd.
- On macOS systems, it is either located in /Library/WebServer/Documents or /usr/htdocs.
- On Windows, it is located in C:\OSGeo4W\apache\htdocs, assuming Apache was installed with the OSGeo4W installer and the default path.
After we locate the root folder of our Apache web server, we are only a few steps away from creating our first web page:
- Make sure you have write permission to Apache's root folder.
- Create a new file called map.html.
- Open the file with a text or a code editor. A good code editor with syntax highlighting can gradually help correct typing errors. More advanced editors (for example, Atom, Visual Studio Code) can even spot some syntax errors.