WebFaction
Community site: login faq

How do I install Apache with PHP-FPM?

asked 11 May '17, 01:22

ryans ♦♦
5.0k73158
accept rate: 43%

Why would I want to do this? What advantages does it bring that I don't get with WebFaction's default PHP setup? Are there any drawbacks? Asking for a friend ;)

(11 May '17, 15:10) seanf

First, create a new Custom Application (listening on port) via the Control Panel and attach it to a website record.

The actual installation will be performed as follows:

git clone 'https://github.com/rsanden/wf-apache-php-fpm'
cd wf-apache-php-fpm
nano config
./install.bash

The "nano config" step is to set the following options in the config file:

  • STACKNAME: The name of this Apache+PHP-FPM stack, which will have associated log files in $HOME/logs/user
  • PREFIX: The install location where the Apache+PHP-FPM will be installed
  • PORT: The port associated with the Custom Application (listening on port) created via the Control Panel
  • DOMAIN1: The domain name that the Apache+PHP-FPM stack will serve. (you can add more later in httpd.conf)
  • APP1: The path to the website files that the Apache+PHP-FPM stack will serve (you can add more later with virtualhosts)

After installation, the following are done for you:

  • start, stop, and restart scripts are created in the $PREFIX/bin directory
  • The start script is run to start the instance
  • A cronjob is created to start the instance once every 20 minutes if it's not running
permanent link
This answer is marked "community wiki".

answered 11 May '17, 02:18

ryans ♦♦
5.0k73158
accept rate: 43%

edited 11 May '17, 02:37

Where to put apps served by this custom apache? Should I create a Static application for them or Static/CGI/PHP-7.0

(15 Jul '17, 13:47) Hubaishan

Create a new PHP application, and your initial app is specified as APP1 in the config during the setup. You can add more later to your new instance htttpd.conf file. You can use the existing example of APP1 as a template for future apps. If you have any questions please feel free to open a support ticket.

(15 Jul '17, 22:46) NickR ♦♦

Do you plan to update your git from time to time (or would it better to fork it)?

What would be the best approach to update the stack? Just install everything again from the script?

(27 Feb, 12:04) marcel

I would suggest forking it as then you have full control over the versions. Also it should be easier to install everything again to update, however you could update in place.

(27 Feb, 14:39) aaront ♦♦

How to use this with SSL website

(16 Mar, 17:51) Hubaishan

The same as any other application, SSL happens in the control panel/nginx proxy layer and has nothing to do with a custom application.

(16 Mar, 21:36) johns ♦♦
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×221
×6

question asked: 11 May '17, 01:22

question was seen: 1,155 times

last updated: 16 Mar, 21:36

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM