2015-11-10 12:06:59 +01:00
# Configuration
2015-11-10 12:08:58 +01:00
Once Xen Orchestra is installed, you can configure some parameters in the configuration file. Let's see how to do that.
## Configuration
2019-01-14 14:00:16 +01:00
The configuration file is located at `/etc/xo-server/config.toml` .
2015-11-10 12:08:58 +01:00
### User to run XO-server as
2018-05-14 16:40:39 -04:00
By default, XO-server runs as 'root'. You can change that by uncommenting these lines and choose whatever user/group you want:
2015-11-10 12:08:58 +01:00
2019-01-14 14:00:16 +01:00
```toml
user = 'nobody'
group = 'nogroup'
2015-11-10 12:08:58 +01:00
```
2019-01-22 13:57:48 -02:00
**Warning!** A non-privileged user requires the use of ``sudo` ` to mount NFS shares. See [installation from the sources ](from_the_sources.md ).
2015-11-10 13:52:45 +01:00
2015-11-10 12:08:58 +01:00
### HTTP listen address and port
2018-05-14 16:40:39 -04:00
By default, XO-server listens on all addresses (0.0.0.0) and runs on port 80. If you need to, you can change this in the `# Basic HTTP` section:
2015-11-10 12:08:58 +01:00
2019-01-14 14:00:16 +01:00
```toml
host = '0.0.0.0'
port = 80
2015-11-10 12:08:58 +01:00
```
### HTTPS
2018-05-14 16:40:39 -04:00
XO-server can also run in HTTPS (you can run HTTP and HTTPS at the same time) - just modify what's needed in the `# Basic HTTPS` section, this time with the certificates/keys you need and their path:
2015-11-10 12:08:58 +01:00
2019-01-14 14:00:16 +01:00
```toml
host = '0.0.0.0'
port = 443
certificate = './certificate.pem'
key = './key.pem'
2015-11-10 12:08:58 +01:00
```
> If a chain of certificates authorities is needed, you may bundle them directly in the certificate. Note: the order of certificates does matter, your certificate should come first followed by the certificate of the above certificate authority up to the root.
2016-02-16 16:16:22 +01:00
#### HTTPS redirection
If you want to redirect everything to HTTPS, you can modify the configuration like this:
```
# If set to true, all HTTP traffic will be redirected to the first HTTPs configuration.
2016-02-16 17:03:54 +01:00
redirectToHttps: true
2016-02-16 16:16:22 +01:00
```
2016-02-16 17:03:54 +01:00
This should be written just before the `mount` option, inside the `http:` block.
2015-11-10 12:08:58 +01:00
### Link to XO-web
2018-05-14 16:40:39 -04:00
You shouldn't have to change this. It's the path where `xo-web` files are served by `xo-server` .
2015-11-10 12:08:58 +01:00
2019-01-14 14:00:16 +01:00
```toml
[http.mounts]
'/' = '../xo-web/dist/'
2015-11-10 12:08:58 +01:00
```
2018-02-21 09:52:31 +01:00
### Custom certificate authority
2018-05-14 16:40:39 -04:00
If you use certificates signed by an in-house CA for your XenServer hosts, and want to have Xen Orchestra connect to them without rejection, you need to add the `--use-openssl-ca` option in Node, but also add the CA to your trust store (`/etc/ssl/certs` via `update-ca-certificates` in your XOA).
2018-02-21 09:52:31 +01:00
To enable this option in your XOA, edit the `/etc/systemd/system/xo-server.service` file and add this:
```
Environment=NODE_OPTIONS=--use-openssl-ca
```
Don't forget to reload `systemd` conf and restart `xo-server` :
```
# systemctl daemon-reload
# systemctl restart xo-server.service
```
2015-11-10 12:08:58 +01:00
### Redis server
2018-05-14 16:40:39 -04:00
By default, XO-server will try to contact Redis server on `localhost` , with the port `6379` . But you can define whatever you want:
2015-11-10 12:08:58 +01:00
2019-01-14 14:00:16 +01:00
```toml
uri = 'tcp://db:password@hostname:port '
2015-11-10 12:08:58 +01:00
```
2016-02-16 16:07:00 +01:00
### Proxy for XenServer updates and patches
To check if your hosts are up-to-date, we need to access `http://updates.xensource.com/XenServer/updates.xml` .
2018-05-14 16:40:39 -04:00
And to download the patches, we need access to `http://support.citrix.com/supportkc/filedownload?` .
2016-02-16 16:07:00 +01:00
2018-05-14 16:40:39 -04:00
To do that behind a corporate proxy, just add the `httpProxy` variable to match your current proxy configuration.
2016-02-16 16:07:00 +01:00
2016-02-16 17:04:39 +01:00
You can add this at the end of your config file:
2019-01-14 14:00:16 +01:00
```toml
2016-02-16 16:07:00 +01:00
# HTTP proxy configuration used by xo-server to fetch resources on the Internet.
#
# See: https://github.com/TooTallNate/node-proxy-agent#maps-proxy-protocols-to-httpagent-implementations
2019-01-14 14:00:16 +01:00
httpProxy = 'http://username:password@proxyAddress:port '
2016-02-16 16:07:00 +01:00
```
2015-11-10 12:08:58 +01:00
### Log file
2016-10-04 14:00:50 +02:00
On XOA, the log file for XO-server is in `/var/log/syslog` . It contains all the server information returned and can be a real help when you have trouble.