Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-3465: Added Nginx vhost template #1704

Merged
merged 5 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 0 additions & 124 deletions code_samples/install/vhost_template/vhost.template

This file was deleted.

31 changes: 24 additions & 7 deletions docs/getting_started/install_ibexa_dxp.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,21 @@ for information on how to do it on different systems.

### Set up virtual host

Prepare a [virtual host configuration](https://httpd.apache.org/docs/2.4/vhosts/) for your site.
Prepare a [virtual host configuration](https://en.wikipedia.org/wiki/Virtual_hosting) for your site.

You can copy [the example vhost file](https://github.com/ezsystems/developer-documentation/tree/master/code_samples/install/vhost_template/vhost.template)
#### Apache

You can copy [the example vhost file](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/apache2/vhost.template)
to `/etc/apache2/sites-available` as a `.conf` file and modify it to fit your project.

Specify `/<your installation directory>/public` as the `DocumentRoot` and `Directory`.
Uncomment the line that starts with `#if [APP_ENV]` and set the value to `prod` or `dev`,
depending on the environment that you are configuring:
Specify `/<your installation directory>/public` as the `DocumentRoot` and `Directory`, or ensure `BASEDIR` is set in the environment.
Uncomment the line that starts with `#if [APP_ENV]` and set the value to `prod` or `dev`, depending on the environment that you are configuring,
or ensure `APP_ENV` is set in the environment.

```
SetEnvIf Request_URI ".*" APP_ENV=prod
```

#### Enable virtual host

When the virtual host file is ready, enable the virtual host and disable the default:

``` bash
Expand All @@ -378,6 +378,23 @@ service apache2 restart
Open your project in the browser by visiting the domain address, for example `http://localhost:8080`.
You should see the welcome page.

#### nginx

You can use [this example vhost file](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/nginx/vhost.template)
and modify it to fit your project. You will also need the `ibexa_params.d` files that should reside in a subdirectory below where the main file is,
[as is shown here](https://github.com/ibexa/post-install/tree/main/resources/templates/nginx).


Specify `/<your installation directory>/public` as the `root`, or ensure `BASEDIR` is set in the environment.
Ensure `APP_ENV` is set to `prod` or `dev` in the environment, depending on the environment that you are configuring, and uncomment the line that starts with `#if[APP_ENV`.

When the virtual host file is ready, enable the virtual host and disable the default.
Finally, restart the nginx server.
The command may vary depending on your Linux distribution.

Open your project in the browser by visiting the domain address, for example `http://localhost:8080`.
You should see the welcome page.

## Post-installation steps

!!! note "Security checklist"
Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure_and_maintenance/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can configure several environments, such as production, development or stagi

## Web server configuration

For example, using Apache, in the [`VirtualHost` example](https://github.com/ezsystems/developer-documentation/tree/master/code_samples/install/vhost_template/vhost.template) in your installation, the required `VirtualHost` configurations have been already included. You can switch to the desired environment by setting the `ENVIRONMENT` variable to `prod`, `dev` or another custom value, like in the following example:
For example, using Apache, in the [`VirtualHost` example](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/apache2/vhost.template) in your installation, the required `VirtualHost` configurations have been already included. You can switch to the desired environment by setting the `ENVIRONMENT` variable to `prod`, `dev` or another custom value, like in the following example:

```
# Environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ See [Security advisory: EZSA-2020-002.](https://developers.ibexa.co/security-adv
### Block execution of scripts in `var` directory

Make sure the web server blocks the execution of PHP files and other scripts in the `var` directory.
See [vhost.template.](https://github.com/ezsystems/developer-documentation/tree/master/code_samples/install/vhost_template/vhost.template#L80)
See the line below `# Disable .php(3) and other executable extensions in the var directory` in the
[virtual host configuration](https://raw.githubusercontent.com/ibexa/post-install/main/resources/templates/apache2/vhost.template).

### Use secure password hashing

Expand Down