User Tools

Site Tools


gemini-php

This is an old revision of the document!


Table of Contents

Gemini-PHP

A Gemini server written in PHP. This code is designed to be simple to understand (we'll use it in our socket programming workshops). If you have any questions or want to get in touch, you can join our community on Matrix at #gemini-php:glasgow.social

Download

You can view the source, download the latest tarball or git clone it via:

git clone https://coding.openguide.co.uk/git/gemini-php/

Getting Started

  • Clone the repository
git clone https://coding.openguide.co.uk/git/gemini-php/
  • Enter the project directory and create a certificate for your server (a self signed certificate is fine, in fact it's encouraged!)
cd gemini-php
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
  • Combine your private key with the certificate and put it in the certs directory
 *  cp cert.pem certs/combined.pem
 *  cat key.pem >> certs/combined.pem
  • Create a config file
cp config.php.sample config.php
  • Then edit it with the location of your new certificate (certs/combined.pem) - most other options are optional
  • Start your server with:
php server.php
  • You should be able to visit your new server in any Gemini client (remember to open your firewall if needed [port 1965]).
  • The default file it serves (like an index.html) is at hosts/default/index.gemini
gemini-php.1601257480.txt.gz · Last modified: 2020/09/28 02:44 by admin