Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2021-04-15 08:09:12

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: Alternative apache + php install

Ross, it’s like you’re in my head. Exactly what I’ve done, too. Bravo!

Offline

#26 2021-04-15 08:15:35

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Alternative apache + php install

Algaris wrote #329782:

After trying various solutions on my Mac I decided to setup my own Ubuntu server.

gaekwad wrote #329784:

This is literally what I did & still do. Works really well.

You’re both way ahead of me on this. Someday maybe I’ll get to that but I still like to be able to quickly switch from work to home or garden and not be tied to infrastructure. (As if to prove the point, O2 have managed to switch off our work DSL broadband connection without switching on the new cable connection leaving four freelancers stranded and at their mercy. Having a local dev environment is handy in such cases).

phiw13 wrote #329732:

For my own needs, I went the Homebrew route, their Apache & PHP (8 & 7.4) packages. Works nicely on MacOS 11. I use the MySQL 8 package directly from Oracle, with its easy-to-use-and-configure MacOS installer.

I have almost this setup except with Laravel Valet which sits on top of those homebrew components. It adds DnsMasq to the mix which makes every folder in the /Sites folder (or whatever you use) immediately available as foldername.test (custom exceptions are possible). It’s basically silently there in the background; no virtualhosts, no etc hosts file. Setting up a site is basically copying a folder and initiating a database, then running /setup. Switching from laptop to work computer (with same username on both) means just copying across the folder and importing the db.

One caveat is no .htaccess as it uses nginx in the background. I was unsure about that to start with but in practice you have no exposure to nginx and Textpattern’s expanded url schemes has made it less necessary to “resort to” .htaccess. Textpattern works with the standard valet driver and I’ve found a custom driver for txp is not necessary.


TXP Builders – finely-crafted code, design and txp

Offline

#27 2021-04-15 12:40:21

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: Alternative apache + php install

jakob wrote #329832:

One caveat is no .htaccess as it uses nginx in the background. I was unsure about that to start with but in practice you have no exposure to nginx and Textpattern’s expanded url schemes has made it less necessary to “resort to” .htaccess. Textpattern works with the standard valet driver and I’ve found a custom driver for txp is not necessary.

Make some noise if you need some help with Nginx, I only started learning it since makss added a bunch of support for it in Textpattern back in a previous branch, and now it’s my go-to for nearly everything.

This link should take you to the current / latest incarnation of the textpattern.com Nginx server block on GitHub, which has been honed & tweaked over the years.

Last edited by gaekwad (2021-04-15 12:40:31)

Offline

#28 2021-06-22 00:07:30

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Alternative apache + php install

Related – a PSA:

The next release of macOS –macOS 12 “Monterey”– removes the pre-installed PHP. via Michael Tsai

My Homebrew based install works quite well. I’ve added a monthly TODO note to my calendar to remind me to check for (eventual) updates.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#29 2021-12-27 12:00:45

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Alternative apache + php install

jakob wrote #329832:

I still like to be able to quickly switch from work to home or garden and not be tied to infrastructure.

Yep. I love this mobility, and I just used it over the xmas weekend.

I have almost this setup except with Laravel Valet which sits on top of those homebrew components. It adds DnsMasq to the mix which makes every folder in the /Sites folder (or whatever you use) immediately available as foldername.test ; no virtualhosts, etc.

That is new to me, and though I don’t really mind setting up virtualhosts, I’ve not liked having to remember editing the hosts file in tandem. I might give valet a try in the short term.

My late 2011 mbp is miraculously still running, but showing signs of glitches and trackpad failure and is horribly supported by Apple anymore.

But I’ve decided I’m not buying anymore Apple laptops (even now we’ll be able to work on them…too late). I can’t justify the high cost and resource consumption for another shiny Apple thing unless, as Pete mentioned once, I can find a refurb 2014 and make that the daily office caddy, which I might still have to do if the current goes belly up.

As for web dev and hosting my own domain and sites, which is all I need to worry about anymore, I think I am ready to try a raspberry pi. They even have an interesting pc setup now, the keyboard and hub 400, so maybe that’s a laptop replacer. At 109,95 €, it’s a lot cheaper than even the cheapest Apple product. Just need a screen to plug onto. I can live without the offsite mobility, as long as I could move around the house via wifi.

(What’s the average lifespan of an RPi, Pete? The late 2011 mbp cost me a about 1.2K and 10 years seems about end of life for it. If a RPi lasted three years, that’s still a big savings over a decade, and Apple laptops are a lot more expensive now, too.)

And the more I read about setting up a stand-alone solar-powered system (de Decker does his off the balcony of his apartment) the more I think I can pull it off. In fact, for me, I think setting up the web server software and router configurations will be the hardest part, not the power. So that goal is on the radar. We only need to move first (a long struggle of a story) so I can know if good sunlight will even make it feasible, but I think I can run four websites easily enough with the right panel/battery arrangement, and even a small wind turbine can be wired in to the controller to provide more charge in the night hours, helping to ensure 24-hr uptime through nights/winter.

Overall goals:

  1. Low footprint/impact web design
  2. Green/sustainable hosting (myself, eventually)
  3. Low cost/impact hardware/software
  4. Decentralized / privacy-respecting

I’m getting there with 1.
2 will take at least another year.
No better time than the present for 3.
4 is inherent.

First step is to just get the RPi and local dev/hosting set up. I need Txp, so an amp stack on RPi will be a necessary learning exercise for me. The solar elements and live hosting will come later, lodgings permitting.

Last edited by Destry (2021-12-27 12:02:45)

Offline

#30 2021-12-27 15:42:19

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: Alternative apache + php install

Destry wrote #332333:

What’s the average lifespan of an RPi, Pete?

I have owned ~50 or so RPi over time, and I’ve had maybe 10% fail at a physical level. Ballpark: I would expect 4-6 years from an RPi, less if you rag them hard and more if they’re idle most of the time.

The most common point of non-permanent failure in my experience is the SD card. Get a high endurance card and you’ll get more life out of it, but factor in they will fail at some stage (i.e. take backups).

Don’t get RPi 2 as they have contemptible spring clips on their SD slot and they’re hateful things. RPi 3 are a good compromise, they will run AMP stack stuff just fine and they’re at a lower price point than the RPi 4, plus there’s good stocks generally. Get a good power supply, the official one is worth the money but any 5V DC @ 2A wall wart would do the job just fine. A stable 5V supply is invaluable. Get a powered USB if you intend to attach stuff to it, as this leaves the power for the main board and a much happier experience all round.

I have ended up moving away from RPi for dev stuff since I’m reducing the amount of stuff in the office (Stef can likely attest there was a lot of hardware crammed into one room), and I’m Marie Kondo-ing my way to a better life.

I may have a very old build guide for Textpattern + AMP on Raspbian somewhere in my stash, I’ll have a look – you’re welcome to a copy of it should I find it. It was intended as a series of blog posts but never made it that far, so crib as you need to.

Offline

#31 2021-12-27 15:46:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: Alternative apache + php install

gaekwad wrote #332335:

I may have a very old build guide for Textpattern + AMP on Raspbian somewhere in my stash, I’ll have a look – you’re welcome to a copy of it should I find it. It was intended as a series of blog posts but never made it that far, so crib as you need to.

Found it. Exported to a 55-page PDF. Drop me a line if you’d like a copy, it’s 2015-era but much of it still applies.

Offline

#32 2022-02-03 02:21:22

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Alternative apache + php install

Ref – MacOS + Homebrew PHP

FWIW – installing ImageMagick and compiling the imagick extension for Homebrew PHP:
ma.ttias.be/install-phps-imagick-extension-on-mac-with-brew/

In Textpattern development context that might be more important in the future. It seems that future image management within Textpattern would really like to have ImageMagick installed.

Works perfectly. It installs a few-too-many Imagick depencies (GhostScript…, DocBook…) but OK. If you have various versions of PHP I suppose you’ll need to manually copy the extension to the relevant locations and update the relevant php.ini files.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB