{"id":28381438,"url":"https://github.com/marcantondahmen/server-switcher","last_synced_at":"2026-04-11T19:33:28.457Z","repository":{"id":228971159,"uuid":"652007748","full_name":"marcantondahmen/server-switcher","owner":"marcantondahmen","description":"Easily switch between servers and PHP versions","archived":false,"fork":false,"pushed_at":"2025-02-05T08:59:48.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T02:40:43.959Z","etag":null,"topics":["apache","automad","developer-tools","homebrew","macos","nginx","php","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcantondahmen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["marcantondahmen"],"ko_fi":"marcantondahmen","custom":["https://paypal.me/marcantondahmen"]}},"created_at":"2023-06-10T19:31:23.000Z","updated_at":"2025-02-05T08:59:51.000Z","dependencies_parsed_at":"2024-03-21T12:31:21.184Z","dependency_job_id":"2ed60268-0d8f-4922-a3cb-71abc8f5593f","html_url":"https://github.com/marcantondahmen/server-switcher","commit_stats":null,"previous_names":["marcantondahmen/server-switcher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcantondahmen/server-switcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcantondahmen%2Fserver-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcantondahmen%2Fserver-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcantondahmen%2Fserver-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcantondahmen%2Fserver-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcantondahmen","download_url":"https://codeload.github.com/marcantondahmen/server-switcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcantondahmen%2Fserver-switcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31693272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","automad","developer-tools","homebrew","macos","nginx","php","shell"],"created_at":"2025-05-30T04:05:28.978Z","updated_at":"2026-04-11T19:33:28.432Z","avatar_url":"https://github.com/marcantondahmen.png","language":"Shell","funding_links":["https://github.com/sponsors/marcantondahmen","https://ko-fi.com/marcantondahmen","https://paypal.me/marcantondahmen"],"categories":[],"sub_categories":[],"readme":"# Server Switcher\n\nEasily switch between servers, proxies and PHP versions on _macOS_ using [Homebrew](https://brew.sh) and [fzf](https://github.com/junegunn/fzf).\n\n---\n\nManaging multiple webservers and PHP version for development along with several different configurations can be messy after a while.\nThe `server-switcher` bundles all needed config files to run Apache, Nginx, Proxies and PHP without touching the default configuration.\n\n## Installation\n\nInstall _Apache_, _Nginx_, _PHP_ and _fzf_:\n\n```bash\nbrew install httpd\nbrew install nginx\nbrew install php\nbrew install fzf\n```\n\nOlder PHP versions can be added as well and will be automatically picked up by the switcher:\n\n```bash\nbrew install php@8.0\nbrew install php@8.1\n```\n\nThat's all.\n\n## Configuration\n\nThe basic configuration for the servers as well as for PHP-FPM has to be placed in a single `.env` file in the root of this repository:\n\n```bash\nSERVER_NAME=my-server.local\nUSER=username\nDOC_ROOT=/Users/username/dev\nPORT=8080\nPHP_PORT=9005\nPROXY_PATH=some-subdirectory\nPROXY_PORT=3333\n```\n\n| Name          | Description                                                                                                                                  |\n| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| `SERVER_NAME` | The server name                                                                                                                              |\n| `USER`        | The username for running the servers as well as PHP                                                                                          |\n| `DOC_ROOT`    | The document root directory                                                                                                                  |\n| `PORT`        | The server's port                                                                                                                            |\n| `PHP_PORT`    | The port where PHP port, is usually `9000` \u0026mdash; make sure to change that one to another number such as `9005` in order to avoid conflicts |\n| `PROXY_PATH`  | The path for redirecting the proxy to \u0026mdash; more below                                                                                     |\n| `PROXY_PORT`  | The port for the proxy                                                                                                                       |\n\n### Nginx Locations\n\nThe switcher looks for `index.php` files on startup and dynamically adds location blocks for those pages to a temporary `nginx.conf` that is used to start the server.\n\n### Proxies\n\nSince this setup is basically made for developing and testing PHP applications locally, it is sometimes also required to test an application's\nbehavior when being behind a proxy. The switcher provides an easy to use interface for spinning up an Apache proxy that is pointing to a subdiretory (`PROXY_PATH`)\nthat is hosted by Nginx or vice versa.\n\n## Usage\n\nIn order to use the switcher, simply run the `server-switcher.sh` inside this repository. However it is probaly more convenient to add a little alias to your shell config:\n\n```\nalias srv='sh ~/server-switcher/server-switcher.sh'\n```\n\nand then invoke the switcher with just typing `srv` in your terminal to get nice fuzzy-finder menu with all possible combinations of servers and PHP versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcantondahmen%2Fserver-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcantondahmen%2Fserver-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcantondahmen%2Fserver-switcher/lists"}