GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - getstackhead/sample-project-php: Example StackHead configuration for a PHP application

This repository was archived by the owner on Feb 26, 2024. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.stackhead/project
.stackhead/project
 
 
Dockerfiles
Dockerfiles
 
 
src/html
src/html
 
 
.gitignore
.gitignore
 
 
.markdownlintignore
.markdownlintignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
README.md
README.md
 
 
ansible.cfg
ansible.cfg
 
 
docker-compose.yml
docker-compose.yml
 
 

Repository files navigation

PHP sample project

This is a sample repository for deploying a PHP application and serving it on a domain using StackHead, the Open-Source Web Server management.

It provides examples for deploying a single and multi container applications.

Requirements

In order to try out this sample project, you'll need the following:

  • StackHead CLI binary file
  • Ansible 2.10 or later
  • a web server with root SSH access (we recommend renting a pay-per-use VPS at Hetzner. Get 20€ cloud balance for free)
  • a top level (sub) domain with A record pointing to your server IP

Initialize StackHead by running the command below. This will install all dependencies required.

stackhead-cli init

How to use

Server provisioning

stackhead-cli setup 159.69.20.148

After provisioning completed, you should see the Nginx default page when opening your domain in your browser.

Application deployment

The following sections describe how to configure the samples for your server and domain. There are two differently sized projects, consisting of one single container and multiple containers.

Single container application

  1. Adjust the project settings in .stackhead/project/single-container.stackhead.yml

    1. Set your own domain in domain
  2. Validate your project file using the validate command:

    stackhead-cli project validate ./.stackhead/project/single-container.stackhead.yml
  3. Deploy the application. Make sure to replace 159.69.20.148 with your servers IP address.

    stackhead-cli project deploy ./.stackhead/project/single-container.stackhead.yml 159.69.20.148
  4. After deployment, open the domain in your web browser. You should see a page that prints "Hello world!" alongside the PHP version and successful database connection.

  5. Remove the application:

stackhead-cli project destroy ./.stackhead/project/single-container.stackhead.yml

Multi container application

  1. Adjust the project settings in .stackhead/project/multi-container.stackhead.yml

    1. Set your own domain in domain
  2. Validate your project file using the validate command:

    stackhead-cli project validate ./.stackhead/project/multi-container.stackhead.yml
  3. Deploy the application. Make sure to replace 159.69.20.148 with your servers IP address.

    stackhead-cli project deploy ./.stackhead/project/multi-container.stackhead.yml 159.69.20.148
  4. After deployment, open the domain in your web browser. You should see a page that prints "Hello world!" alongside the PHP version and successful database connection.

    You can access PhpMyAdmin on port 81 (no HTTPS).

  5. Remove the application:

stackhead-cli project destroy ./.stackhead/project/multi-container.stackhead.yml

About

Example StackHead configuration for a PHP application

Topics

ansibleinventory-configuration

Resources

Readme

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.