Cannot access Pydio Server on / instead of /pydio

Hello,

I’ve installed Pydio 8.2.1 on a Debian 9 VPS using the Pydio package repository and tried to change the base url to / instead of /pydio but I cannot get it to work. This is my first time working with Pydio (and also my first post here).

I think these files are relevant to the problem, please let me know if you need more information. I shortened them a bit (removed empty lines and comments) to keep the post short.
/etc/pydio/apache2.conf:

Alias   /       /usr/share/pydio
<Directory "/usr/share/pydio">
        Options FollowSymLinks
        AllowOverride Limit FileInfo
        Order allow,deny
        Allow from all
        Require all granted
</Directory>
AddType application/json .json

/etc/pydio/htaccess:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L]
</IfModule>
AddType application/json .json

Pretty sure I messed up something as well because I changed it back to /pydio and I when I then visit the site (with /pydio appended) I am presented with a blank page (with some HTML and Javascript in the source code).

Could someone help me out here? Greatly appreciated as Pydio seems like a great application.

EDIT: I just realized I should probably mention that I have an NGINX reverse proxy set up in front of it with the following config in the vhost file:

server {
        server_name                     cloud.xxx.xxx;
        listen                          10.0.1.5:80;
        return                          301 https://$server_name$request_uri;
}

server {
        server_name                     cloud.xxx.xxx;
        listen                          10.0.1.5:443 ssl;
        ssl_certificate                 /etc/letsencrypt/live/cloud.xxx.xxx/fullchain.pem;
        ssl_certificate_key             /etc/letsencrypt/live/cloud.xxx.xxx/privkey.pem;
        location                        / {
                                                proxy_pass http://10.0.1.4;
                                                proxy_redirect http://10.0.1.4 https://cloud.xxx.xxx;
                                                proxy_set_header Host $host;
                                                proxy_set_header X-Real-IP $remote_addr;
                                                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                                                proxy_set_header X-Forwarded-Proto $scheme;
                                                #add_header Server: $nginx_version;
                                        }
        client_max_body_size            101G;
        access_log                      /var/log/nginx/cloud.xxx.xxx-access.log;
        error_log                       /var/log/nginx/cloud.xxx.xxx-error.log;
        include                         /etc/nginx/sslsettings.conf;

Hi,
so lets resume this you have a pydio install that works well, but when you configured your reverse proxy you now have an issue when you want to acces pydio using /.

First thing is can you access your pydio instance through it’s address without using the reverse proxy ( if you could test that ).

Hi Zayn,

Sorry for the late reply. I just tested it, with or without using the reverse proxy I get the standard Apache2 page on / and a blank page on /pydio. The blank page does contain some HTML.

Hi,
could show me your pydio’s virtualhost file on apache2 please?

Alias   /pydio       /usr/share/pydio
<Directory "/usr/share/pydio">
        Options FollowSymLinks
        AllowOverride Limit FileInfo
        Order allow,deny
        Allow from all
        Require all granted
</Directory>
AddType application/json .json

Okay, this is what’s inside /etc/apache2/conf-enabled/pydio.conf (without comments and extra line breaks). I see the Alias at the top says /pydio, I changed that to / and now I get a 403 error if I access the site on /. This is where I was earlier as well but messed it up more when I tried to figure it out.

In the Apache logs I see the following error:
AH01276: Cannot serve directory /usr/share/pydio: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive

This directory exists, with an index.php, and everything in there is world readable… I suspect it comes from a rewrite somewhere but I really don’t know…

Hi,
are you using other site combined with this one on the same server, i think that you cannot really use alias with just a / it has to be something like /<whatever>/where the starting slash is mandatory to tell apache what to match on,
i’ve read this documentation on apaches site.

If you do not have other virtualhosted site then you can just make it the default one on your server and every request served on http://< whatever >/ with then redirect you on your default application which would be in this case pydio.

Hi zayn,

I don’t have any other site hosted on that server. Just the default apache2 page that is also there I guess. So from what you tell me it is impossible to host Pydio on /? Well that’s annoying.

Instead of aliassing a directory, why not make /usr/share/pydio the document root so you don’t have to alias things? Is it a security thing? I’m willing to sacrifice some of it to access Pydio on /.

Hi,
quite the contrary if you only have pydio on your server than it should be a piece of cake to have it work on just for instance http://192.168.0.1/ ,
you can make the default request on port 80 all about pydio and therefore you will not even need an alias.

<VirtualHost *:80>
	
	ServerAdmin webmaster@localhost
	Servername your-pydio.com
	ServerAlias www.your-pydio.com	
	DocumentRoot /var/www/pydio/

<Directory /var/www/pydio/>
	AllowOverride All
	Require all granted
</Directory>
	
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

heres a default virtual host file,
you can disable the default apache2 page by using a2dissite 000-default.conf(which is the virtual host file for this default page)

Hi,

Ah nice! So I just have to take your vhost config, change the document root to /usr/share/pydio and that’s it?

EDIT: Oh, and disable the pydio.conf from /etc/apache2/conf-enabled I assume

Yeah exactly and also dont forget to disable the default apache conf,
sudo a2dissite 000-default.conf should do the trick, you can also use the same command on your pydio.conf, usually all of the virtual host files are located in /etc/apache2/sites-available/ and when enabled with sudo a2ensite pydio.conf they create a symbolic link in /etc/apache2/sites-enabled/ folder.

Okay, disabled conf-enabled/pydio.conf, enabled cloud-pydio.conf in sites-enabled and restarted Apache. The contents of cloud-pydio.conf are as follows:

<VirtualHost 10.0.1.4:80>
        ServerAdmin     webmaster@xxx.xxx
        Servername      cloud.xxx.xxx.
        DocumentRoot    /usr/share/pydio/

        <Directory /usr/share/pydio/>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

But now I get a page saying “Oops, cannot find this page!”. It’s Pydio saying that, not the web browser or server(s).
Do you kow what could cause this?

i think you could just put VirutalHost *:80 the * is a wildcard that will take any request on port 80 on this server and redirect them to your pydio which should be the only application on port 80 on your server.

I don’t think that matters, I tried it nevertheless but it made no difference.

Thank you a lot for your help so far btw.

You could take a look at the troubleshooting section
https://pydio.com/en/docs/v8/troubleshooting
maybe will find what’s causing your issue.

Otherwise i will reproduce your case and see what happens.

Hi Zayn,

Again sorry for the delayed reply. Unfortunately I could not manage to fix the error. Are you sure you want to go through the hasle of reprocing my scenario?