# Setting Up Cells on Subdomain with Apache on Ubuntu 22.04

**URL:** <https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915>\
**Category:** Pydio Cells\
**Tags:** install\
**Created:** [June 13, 2024, 11:16am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915 "2024-06-13T11:16:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 13, 2024, 11:16am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/1 "2024-06-13T11:16:41Z")

</div>

### Describe your issue in detail

I am trying to set up Cells to work on a subdomain ([cells.example.com](http://cells.example.com)). I am used to setting up a vhost file that redirects requests for the subdomain to the port on which an app operates, but have not found success trying this with Cells.

I would appreciate any guidance on this front.

### What version of Cells are you using?

`Pydio Cells Home Edition Version: 4.4.2 Built: 04 Jun 24 11:49 +0000 Git commit: 370fe5acdad840eaad6f327d2fde210525c14735 OS/Arch: linux/amd64 Go version: go1.21.10`

### What is the server OS? Database name/version? Browser name or mobile device description (if issue appears client-side)?

`Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-112-generic x86_64)`  
`mariadb Ver 15.1 Distrib 10.6.16-MariaDB`

### What steps have you taken to resolve this issue already?

I have set up a vhost file pointing requests for the desired subdomain to port 8080.

Thank you kindly in advance for your time and attention.

---

<div class="post-metadata">

**Author:** ![bsinou](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/bsinou/32/476_2.png) [@bsinou](https://forum.pydio.com/u/bsinou)\
**Post date:** [June 14, 2024, 4:11pm UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/2 "2024-06-14T16:11:55Z")

</div>

Hi,

That’s a setup that we widely test and use in production (with various reverse proxies, e.g Apache, Caddy, Nginx…) with no problem: it works!

That said, you have to configure Cells and your proxy accordingly: did you follow the instruction from this page: [Pydio | Running Cells behind an Apache reverse proxy](https://pydio.com/en/docs/kb/deployment/running-cells-behind-apache-reverse-proxy)

If it still doesn’t work, can you please provide more details and the error you see in Apache and in Cells ?

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 17, 2024, 1:53am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/3 "2024-06-17T01:53:55Z")

</div>

Hello, and thank you for your reply,

I apologize for my belated response.

I somehow missed that page in my searches, but after following it (using the recommended settings regarding `localhost`, &c.), visiting the subdomain yields a blank page with the singular message:

`Client sent an HTTP request to an HTTPS server.`

This happens even when I explicitly type `https://` into the URL field.

The relevant error from `/var/log/apache2/error.log` is:

`[Mon Jun 17 02:08:22.418560 2024] [proxy_http:error] [pid 167196:tid 140379143738944] (104)Connection reset by peer: [client REDACTED] AH01110: error reading response`

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 17, 2024, 2:25am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/4 "2024-06-17T02:25:53Z")

</div>

Actually, with the `localhost` config, Cells froze on startup. I had to kill the process.

```auto
************************************************************
✗ Error while starting discovery server:
✗ server.Start grpc: listen tcp 127.0.0.1:8030: bind: address already in use
✗ FATAL : shutting down now!
************************************************************
Error: no discovery server

```

I have no idea where 8030 is coming from.

Changing the relevant fields to `127.0.0.1` in vhost and config allows Cells to start, but does not change the error in the browser.

---

<div class="post-metadata">

**Author:** ![bsinou](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/bsinou/32/476_2.png) [@bsinou](https://forum.pydio.com/u/bsinou)\
**Post date:** [June 17, 2024, 7:28am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/5 "2024-06-17T07:28:49Z")

</div>

Could you please provides the results of the `cells configure sites` command and your Apache configuration file ?  
From what you describe, it seems that you are missing something.

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 17, 2024, 8:20am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/6 "2024-06-17T08:20:52Z")

</div>

`cells configure sites`:

```auto
The following sites are currently defined:
+---+------------------------+-------------+----------------------------------+
| # | BIND(S) | TLS | EXTERNAL URL |
+---+------------------------+-------------+----------------------------------+
| 0 | https://127.0.0.1:8080 | Self-signed | https://cells.my.site |
+---+------------------------+-------------+----------------------------------+

```

`/etc/apache2/sites-enabled/cells.my.site.conf`:

```auto
<VirtualHost *:80>
    ServerName cells.my.site
    ServerAlias www.cells.my.site
    
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    RewriteCond %{SERVER_NAME} =cells.my.site
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    ServerName cells.my.site
    AllowEncodedSlashes On
    RewriteEngine On
    SSLProxyEngine On

    ## The order of the directives matters.
    # If Cells is not running with https, consider using ws instead of wss
    ProxyPassMatch "/ws/(.*)" wss://127.0.0.1:8080/ws/$1 nocanon

    ## This rewrite condition is required if using Cells-Sync
    # RewriteCond %{HTTP:Content-Type} =application/grpc [NC]
    # RewriteRule /(.*) h2://127.0.0.1:8080/$1 [P,L]

    ProxyPass "/" "https://127.0.0.1:8080/"
    ProxyPassReverse "/" "https://127.0.0.1:8080/"

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLCertificateFile /etc/letsencrypt/live/cells.my.site/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/cells.my.site/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

```

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 18, 2024, 12:49pm UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/7 "2024-06-18T12:49:22Z")

</div>

Anything jumping out?

---

<div class="post-metadata">

**Author:** ![bsinou](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/bsinou/32/476_2.png) [@bsinou](https://forum.pydio.com/u/bsinou)\
**Post date:** [June 19, 2024, 7:56am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/8 "2024-06-19T07:56:51Z")

</div>

Hi,

It seems you lack the directives to authorize Apache to accept the Cells self-signed certificate:

```auto
SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off`

```

You should also add `nocanon` at the end of these 2 lines:

```auto
ProxyPass "/" "https://127.0.0.1:8080/"
ProxyPassReverse "/" "https://127.0.0.1:8080/"

```

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 19, 2024, 8:52am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/9 "2024-06-19T08:52:20Z")

</div>

Hello again, and thank you always for your help.

I pulled that conf file’s contents straight from the documentation, only changing the relevant info. What would be different for me that I have to add extra things?

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 21, 2024, 9:28pm UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/10 "2024-06-21T21:28:10Z")

</div>

> [@bsinou](#):
>
> ```auto
> SSLProxyEngine On
> SSLProxyVerify None
> SSLProxyCheckPeerCN Off
> SSLProxyCheckPeerName Off
> ...
> 
> ```

These changes do not have any visible effect.

---

<div class="post-metadata">

**Author:** ![pypypypypypypy](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@pypypypypypypy](https://forum.pydio.com/u/pypypypypypypy)\
**Post date:** [June 22, 2024, 8:06am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/11 "2024-06-22T08:06:52Z")

</div>

Using `cells configure sites` to change to using a custom certificate (using a certificate generated by `certbot`) yields a 503 page with the following content:

```auto
Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.4.52 (Ubuntu) Server at cells.my.site Port 443

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [August 21, 2024, 8:07am UTC](https://forum.pydio.com/t/setting-up-cells-on-subdomain-with-apache-on-ubuntu-22-04/5915/12 "2024-08-21T08:07:52Z")

</div>

Closed on August 21, 2024, 8:07am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
