mod_authz_core
provides a high-level interface toauthorization that is much easier to use than using into the relevanthooks directly. The first argument to theRequire
directive givesthe name of the responsible authorization provider. For anyRequire
line,mod_authz_core
will call the authorization providerof the given name, passing the rest of the line as parameters. Theprovider will then check authorization and pass the result as returnvalue.Laravel Forge for creating and managing your PHP servers Posted by Gordon on 1 January 2016, 4:16 pm I’ve tried a few different services to manage servers in the past, such as Command.io and I’ve settled on Laravel’s Forge for its ease of use, low cost and quick responses to any Support tickets, when building or maintaining servers for. You can manage your servers programatically using our robust API, which provides access to the vast majority of Forge features. User Isolation Run each of the sites on your servers as a separate, secure user, preventing compromised applications from accessing other sites on the server. Encodes data into any of the following: Australia Post barcode, Aztec Code, Aztec Runes, Channel Code, Codabar, Codablock-F, Code 11, Code 128, Code 16K, Code 2 of 5 (Including IATA, Datalogic, ITF14, Deutsche Post Leitcode and Identcode), Code 32 (Italian Pharmacode), Code 39, Code 39+, Code 49, Code 93, Code One, Data Matrix (including DMRE), DotCode, Dutch Post KIX, EAN, Grid Matrix, GS-1.
The authz provider is normally called before authentication. If it needs toknow the authenticated user name (or if the user will be authenticated atall), the provider must return
apache2.AUTHZ_DENIED_NO_USER
.This will cause authentication to proceed and the authz provider to becalled a second time.The following authz provider function takes two arguments, one ipaddress and one user name. It will allow access from the given ip addresswithout authentication, or if the authenticated user matches the secondargument:
The following configuration registers this function as provider
foo
and configures it for URL /
:The Forge API allows you to create and interact with servers and sites on Laravel Forge through a simple REST API.
In order to use the API, you should authenticate your request by including your API key as a bearer token value:
Authorization: Bearer API_KEY_HERE
Make sure you have the following content type headers are set on every request:
Accept: application/json
Content-Type: application/json
Forge API is hosted on the following base URI:
https://forge.laravel.com/api/v1
Forge uses conventional HTTP response codes to indicate the success or failure of an API request. The table below contains a summary of the typical response codes:
Code | Description |
---|---|
200 | Everything is ok. |
400 | Valid data was given but the request has failed. |
401 | No valid API Key was given. |
404 | The request resource could not be found. |
422 | The payload has missing required parameters or invalid data was given. |
429 | Too many attempts. |
500 | Request failed due to an internal error in Forge. |
503 | Forge is offline for maintenance. |
show
Response
HTTP Request
GET /api/v1/user
Create Server
Payload
Response
HTTP Request
POST /api/v1/servers
Parameters
Key | Description |
---|---|
provider | The server provider. Valid values are ocean2 for Digital Ocean, linode , vultr , aws , hetzner and custom . |
credential_id | This is only required when the provider is not custom . |
region | The name of the region where the server will be created. This value is not required you are building a Custom VPS server. Valid region identifiers. |
ip_address | The IP Address of the server. Only required when the provider is custom . |
private_ip_address | The Private IP Address of the server. Only required when the provider is custom . |
php_version | Valid values are php74 , php73 ,php72 ,php71 , php70 , and php56 . |
database | The name of the database Forge should create when building the server. If omitted, forge will be used. |
maria | Indicates if MariaDB should be installed. Otherwise, MySQL will be installed. |
database_type | Valid values are mysql ,mysql8 ,mariadb ,postgres . |
node_balancer | Determines if the server should be provisioned as a load balancer. |
network | An array of server IDs that the server should be able to connect to. |
recipe_id | An optional ID of a recipe to run after provisioning. |
aws_vpc_id | ID of the existing VPC |
aws_subnet_id | ID of the existing subnet |
aws_vpc_name | When creating a new one |
Server Status
Servers take about 10 minutes to provision. Once the server is ready to be used, the
is_ready
parameter on the server will be true
. You should not repeatedly ping the Forge API asking if the server is ready. Instead, consider pinging the endpoint once every 2 minutes.Valid Sizes
Check the Regions endpoint for the available sizes and regions IDs.
Custom VPS
While creating a custom VPS, the response of this endpoint will contain a
provision_command
attribute:List Servers
Response
HTTP Request
GET /api/v1/servers
Get Server
Response
HTTP Request
GET /api/v1/servers/{id}
Update Server
Payload
Response
HTTP Request
PUT /api/v1/servers/{id}
Update Database Password
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/database-password
This endpoint will update Forge's copy of the primary database password which should be used to authenticate the creation of new databases and database users. This is typically only needed if you are working with a Forge server that was built before database administration was added to Forge.
Delete Server
HTTP Request
DELETE /api/v1/servers/{id}
Reboot Server
HTTP Request
POST /api/v1/servers/{id}/reboot
Revoke Forge access to server
HTTP Request
POST /api/v1/servers/{id}/revoke
Reconnect revoked server
Response
F Bar 2 0 5 – Manage Laravel Forge Servers Download
HTTP Request
POST /api/v1/servers/{id}/reconnect
This endpoint will return an SSH key which you will need to add to the server. Once the key has been added to the server, you may 'reactivate' it.
Reactivate revoked server
HTTP Request
POST /api/v1/servers/{id}/reactivate
Get Recent Events
Response
HTTP Request
GET /api/v1/servers/events
Parameters
Key | Description |
---|---|
server_id | Optionally specify a server_id to get recent events of only this server. |
Start Service
HTTP Request
POST /api/v1/servers/{id}/services/start
Payload
Stop Service
HTTP Request
POST /api/v1/servers/{id}/services/stop
Payload
Restart Service
HTTP Request
POST /api/v1/servers/{id}/services/restart
Payload
Reboot MySQL
HTTP Request
POST /api/v1/servers/{id}/mysql/reboot
Stop MySQL
HTTP Request
POST /api/v1/servers/{id}/mysql/stop
Reboot Nginx
HTTP Request
POST /api/v1/servers/{id}/nginx/reboot
Stop Nginx
HTTP Request
POST /api/v1/servers/{id}/nginx/stop
Reboot Postgres
HTTP Request
POST /api/v1/servers/{id}/postgres/reboot
Stop Postgres
HTTP Request
POST /api/v1/servers/{id}/postgres/stop
Reboot PHP
Payload
HTTP Request
POST /api/v1/servers/{id}/php/reboot
Install Blackfire
Payload
HTTP Request
POST /api/v1/servers/{id}/blackfire/install
Remove Blackfire
HTTP Request
DELETE /api/v1/servers/{id}/blackfire/remove
Install Papertrail
Payload
HTTP Request
POST /api/v1/servers/{id}/papertrail/install
Remove Papertrail
HTTP Request
DELETE /api/v1/servers/{id}/papertrail/remove
Create Daemon
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/daemons
List Daemons
Response
HTTP Request
GET /api/v1/servers/{serverId}/daemons
Get Daemon
Response
HTTP Request
GET /api/v1/servers/{serverId}/daemons/{daemonId}
Delete Daemon
HTTP Request
DELETE /api/v1/servers/{serverId}/daemons/{daemonId}
Restart Daemon
HTTP Request
POST /api/v1/servers/{serverId}/daemons/{daemonId}/restart
Create Rule
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/firewall-rules
Available Rule Types
You may specify
allow
or deny
as the rule type.List Rules
Response
HTTP Request
GET /api/v1/servers/{serverId}/firewall-rules
Get Rule
Response
HTTP Request
GET /api/v1/servers/{serverId}/firewall-rules/{ruleId}
Delete Rule
HTTP Request
DELETE /api/v1/servers/{serverId}/firewall-rules/{ruleId}
Create Job
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/jobs
Parameters
Key | Description |
---|---|
frequency | The frequency in which the job should run. Valid values are minutely , hourly , nightly , weekly , monthly , reboot , and custom |
minute | Required if the frequency is custom . |
hour | Required if the frequency is custom . |
day | Required if the frequency is custom . |
month | Required if the frequency is custom . |
weekday | Required if the frequency is custom . |
List Jobs
Response
HTTP Request
GET /api/v1/servers/{serverId}/jobs
Get Job
Response
HTTP Request
GET /api/v1/servers/{serverId}/jobs/{jobId}
Delete Job
HTTP Request
DELETE /api/v1/servers/{serverId}/jobs/{jobId}
List PHP Versions
Response
HTTP Request
GET /api/v1/servers/{serverId}/php
Install PHP Version
HTTP Request
POST /api/v1/servers/{serverId}/php
Payload
Available Versions
Key | Description |
---|---|
php56 | PHP 5.6 |
php70 | PHP 7.0 |
php71 | PHP 7.1 |
php72 | PHP 7.2 |
php73 | PHP 7.3 |
php74 | PHP 7.4 |
Upgrade PHP Patch Version
You must supply the version to be patched.
HTTP Request
Bookstore 5 1 mac os x.
POST /api/v1/servers/{serverId}/php/update
Payload
Enable OPCache
HTTP Request
POST /api/v1/servers/{serverId}/php/opcache
Disable OPCache
HTTP Request
DELETE /api/v1/servers/{serverId}/php/opcache
Create Database
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/databases
![Forge Forge](https://insmac.org/uploads/posts/2017-11/1510581160_f-bar.png)
Parameters
Key | Description |
---|---|
user | This field is optional. If passed, it will be used to create a new Database User with access to the newly created database. |
password | This field is only required when a user value is given. |
List Databases
Response
HTTP Request
GET /api/v1/servers/{serverId}/databases
Get Database
Response
HTTP Request
GET /api/v1/servers/{serverId}/databases/{databaseId}
Delete Database
HTTP Request
DELETE /api/v1/servers/{serverId}/databases/{databaseId}
Create User
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/database-users
Parameters
Key | Description |
---|---|
databases | An array of database IDs referencing the databases the user has access to. |
List Users
Response
HTTP Request
GET /api/v1/servers/{serverId}/database-users
Get User
Response
HTTP Request
GET /api/v1/servers/{serverId}/database-users/{userId}
Update User
Payload
Response
HTTP Request
PUT /api/v1/servers/{serverId}/database-users/{userId}
This endpoint may be used to update the databases the Database User has access to.
Delete User
HTTP Request
DELETE /api/v1/servers/{serverId}/database-users/{userId}
The
/mysql
endpoints is now deprecated in favour of the new /databases
endpoint. Create Database
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/mysql
Parameters
Key | Description |
---|---|
user | This field is optional. If passed, it will be used to create a new MySQL user with access to the newly created database. |
password | This field is only required when a user value is given. |
List Databases
Response
HTTP Request
GET /api/v1/servers/{serverId}/mysql
Get Database
Response
F Bar 2 0 5 – Manage Laravel Forge Servers 1.8.9
HTTP Request
GET /api/v1/servers/{serverId}/mysql/{databaseId}
Delete Database
HTTP Request
DELETE /api/v1/servers/{serverId}/mysql/{databaseId}
The
/mysql-users
endpoint is now deprecated in favour of the new /database-users
endpoint.Create User
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/mysql-users
Parameters
Key | Description |
---|---|
databases | An array of database IDs referencing the databases the user has access to. |
List Users
Response
HTTP Request
GET /api/v1/servers/{serverId}/mysql-users
Get User
Response
HTTP Request
GET /api/v1/servers/{serverId}/mysql-users/{userId}
Update User
Payload
Response
HTTP Request
PUT /api/v1/servers/{serverId}/mysql-users/{userId}
This endpoint may be used to update the databases the MySQL user has access to.
Delete User
HTTP Request
DELETE /api/v1/servers/{serverId}/mysql-users/{userId}
Create Site
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites
Available site types
Key | Description |
---|---|
php | General PHP/Laravel Application. |
html | Static HTML site. |
symfony | Symfony Application. |
symfony_dev | Symfony (Dev) Application. |
symfony_four | Symfony >4.0 Application. |
List Sites
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites
Get Site
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}
Update Site
Payload
Response
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}
This endpoint is used to update the 'web directory', primary name, aliases or whether to use wildcard sub-domains for a given site.
Change Site PHP Version
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/php
Add Site Aliases
Payload
Response
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/aliases
Use this endpoint to add additional site aliases and keep the exiting ones.
Delete Site
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}
Load Balancing
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/balancing
If the server is a load balancer, this endpoint may be used to specify the servers the load balancer should send traffic to.
Load Balancing Methods
Key | Description |
---|---|
round_robin | Requests are evenly distributed across servers |
least_conn | Requests are sent to the server with the least number of active connections |
ip_hash | The server to which a request is sent is determined from the client IP address |
Site Log
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/logs
Response
Create Certificate
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates
Installing An Existing Certificate
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates
Cloning An Existing Certificate
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates
Obtain A LetsEncrypt Certificate
The
dns_provider
object is only required for wildcard sub-domains.Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates/letsencrypt
DNS Provider Types
Type | Extra Fields |
---|---|
cloudflare | cloudflare_api_token . |
route53 | route53_key and route53_secret |
digitalocean | digitalocean_token |
dnssimple | dnssimple_token |
linode | linode_token |
ovh | ovh_endpoint , ovh_app_key , ovh_app_secret and ovh_consumer_key |
google | google_credentials_file |
List Certificates
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/certificates
Get Certificate
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}
Get Signing Request
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}/csr
This endpoint may be used to get the full certificate signing request content.
Install Certificate
Payload
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}/install
Activate Certificate
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}/activate
Delete Certificate
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id}
Create Key
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/keys
List Keys
Response
HTTP Request
GET /api/v1/servers/{serverId}/keys
Get Key
Response
HTTP Request
GET /api/v1/servers/{serverId}/keys/{keyId}
Delete Key
HTTP Request
DELETE /api/v1/servers/{serverId}/keys/{keyId}
Create Worker
You may pass
php
as the php_version
value to use the server's default PHP CLI version.Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/workers
List Workers
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/workers
Get Worker
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/workers/{id}
Delete Worker
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/workers/{id}
Restart Worker
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/workers/{id}/restart
Create Rule
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/redirect-rules
Type | Description |
---|---|
redirect | Creates a temporary 302 redirect |
permanent | Create a permanent 301 redirect |
List Redirect Rules
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/redirect-rules
Get Rule
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/redirect-rules/{id}
Delete Rule
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/redirect-rules/{id}
Create Security Rule
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/security-rules
You may leave
path
empty to protect all routes within your site.List Security Rules
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/security-rules
Get Security Rule
Response
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/security-rules/{id}
Delete Security Rule
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/security-rules/{id}
Enable Quick Deployment
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/deployment
Disable Quick Deployment
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/deployment
Get Deployment Script
The response is a string for this request.
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/deployment/script
Update Deployment Script
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/deployment/script
Deploy Now
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/deployment/deploy
Reset Deployment Status
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/deployment/reset
Get Deployment Log
The response is a string for this request.
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/deployment/log
Get Nginx Configuration
The response is a string for this request.
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/nginx
Update Nginx Configuration
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/nginx
Get .env File
The response is a string for this request.
HTTP Request
GET /api/v1/servers/{serverId}/sites/{siteId}/env
Update .env File
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/env
Install New
Payload
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/git
Parameters
Key | Description |
---|---|
provider | The repository provider. Valid values are github , gitlab , gitlab-custom , bitbucket , and custom . |
composer | Whether to install Composer dependencies. Valid values are true or false . |
Update Repository
Payload
HTTP Request
PUT /api/v1/servers/{serverId}/sites/{siteId}/git
Remove Project
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/git
Install
Payload
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/wordpress
Uninstall WordPress
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/wordpress
This endpoint will uninstall WordPress and revert the site back to a default state.
Install
Payload
HTTP Request
POST /api/v1/servers/{serverId}/sites/{siteId}/phpmyadmin
Uninstall phpMyAdmin
HTTP Request
DELETE /api/v1/servers/{serverId}/sites/{siteId}/phpmyadmin
This endpoint will uninstall phpMyAdmin and revert the site back to a default state.
List
Response
HTTP Request
GET /api/v1/servers/{server_id}/sites/{site_id}/webhooks
Show
Response
HTTP Request
GET /api/v1/servers/{server_id}/sites/{site_id}/webhooks/{id}
Create
Response
HTTP Request
POST /api/v1/servers/{server_id}/sites/{site_id}/webhooks
Delete
Response
HTTP Request
DELETE /api/v1/servers/{server_id}/sites/{site_id}/webhooks/{id}
Create Recipe
Payload
Response
HTTP Request
POST /api/v1/recipes
List Recipes
Response
HTTP Request
GET /api/v1/recipes
Get Recipe
Response
HTTP Request
GET /api/v1/recipes/{recipeId}
Update Recipe
Payload
Response
HTTP Request
PUT /api/v1/recipes/{recipeId}
Delete Recipe
HTTP Request
DELETE /api/v1/recipes/{recipeId}
Run Recipe
Payload
HTTP Request
POST /api/v1/recipes/{recipeId}/run
List
Response
HTTP Request
GET /api/v1/regions
List
Response
HTTP Request
GET /api/v1/credentials
List Backup Configurations
HTTP Request
GET /api/v1/servers/{serverId}/backup-configs
Response
Create Backup Configuration
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/backup-configs
Available providers
Key | Description |
---|---|
s3 | Amazon S3 |
spaces | DigitalOcean Spaces |
custom | Custom (S3 Compatible, e.g. MinIO) |
When supplying a
custom
provider, you must also provide an endpoint
.Frequency options
hourly
daily
- you must supply atime
in 24 hour formatweekly
- you must supply atime
in 24 hour format and aday
option 0 (Sunday) - 6 (Saturday)custom
- you must supply acustom
value, as a valid cron expression
Update Backup Configuration
Payload
Response
Note: You cannot change the databases to backup of an existing backup configuration.
The payload and options are the same for updating as they are for creating.
Get Backup Configuration
Response
HTTP Request
GET /api/v1/servers/{serverId}/backup-configs/{backupConfigurationId}
Run Backup Configuration
Manually run a backup configuration.
HTTP Request
POST /api/v1/servers/{serverId}/backup-configs/{backupConfigurationId}
Delete Backup Configuration
HTTP Request
DELETE /api/v1/servers/{serverId}/backup-configs/{backupConfigurationId}
Restore Backup
Payload
If no
database
value is provided, Forge will restore the first database available.HTTP Request
POST /api/v1/servers/{serverId}/backup-configs/{backupConfigurationId}/backups/{backupId}
Delete Backup
HTTP Request
DELETE /api/v1/servers/{serverId}/backup-configs/{backupConfigurationId}/backups/{backupId}
List Monitors
HTTP Request
GET /api/v1/servers/{serverId}/monitors
Response
Create Monitor
Payload
Response
HTTP Request
POST /api/v1/servers/{serverId}/monitors
Available Monitors
Monitors work on a % value.
Key | Description |
---|---|
disk | The used disk space |
used_memory | The amount of used memory |
cpu_load | The CPU load |
Operators
gte
- greater than or equal tolte
- less than or equal to
Get Monitor
HTTP Request
GET /api/v1/servers/{serverId}/monitors/{monitorId}
Response
Delete Monitor
HTTP Request
DELETE /api/v1/servers/{serverId}/monitors/{monitorId}
Get Log
HTTP Request
GET /api/v1/servers/{serverId}/logs
Response
File Types
You must specify one of the below
file
types:nginx_access
nginx_error
database
php7x
(wherex
is a valid version number, e.g.php71
) orphp56