Host a website from a folder on your computer
Serve a folder like C:\WAMP\www from your own machine, with its PHP pages running on Ocalt.
Open FabricBefore you start
- The OcaltQL Client is installed and online on the machine.
Steps
- Click Websites & Hosting in the side menu, then + New site.
- Type the Site name (slug). Under Root machine, choose your machine, and set the Root path to the folder, for example C:\WAMP\www.
- Click Create site, then Open site.
What happens next
A folder opens the first of index.oql, index.php, index.py, index.rb, index.pl and index.html, the same order as a site in your namespace, and an address without an extension finds its page the same way (/pricing opens pricing.oql first). Images, styles and downloads come straight off your machine. OcaltQL scripts and pages in PHP, Python, Ruby or Perl are fetched from the machine and run on Ocalt, in WebAssembly, so nothing runs on your computer. Every file a page opens (an include, a config file it reads) is fetched from the folder when the page asks for it, and fetched again on each visit, so an edit on your machine shows on the next load.
Good to know
- A page can only use files inside the site folder. A page that includes something outside it (for example WAMP's own dashboard, which reads C:\WAMP\scripts) stops and says which file it could not open.
- The page runs on Ocalt, so a database that only listens on your computer (localhost) cannot be reached from it. Use a database in OcaltDB, or one that accepts connections from the internet.
- The machine must stay online for the site to answer. The client remembers the folders it serves, so the site comes back by itself after the client updates or the machine restarts. To edit the folder's address later, open the site, click Settings and Edit path.
Still stuck?
Tell us which step stopped you and what you saw on screen. We answer from Support.