Score:1

Apache2 - How to serve static files on a specific folder?

nz flag

I have 2 virtual hosts serving 2 different sites in my Ubuntu Server 20.04 both in port 80 and 443.

I want to use the same server to serve some static files for download on a custom port, let's say 8080.

I added a share_backup_folder.conf configuration file on my /etc/apache2/sites-available with the following content:

<VirtualHost *:8080>
        ServerName vpsxxxxx.ovh.net
        DocumentRoot /var/www/backup

        Alias /backup /var/www/backup
        <Directory /var/www/backup>
                Require all granted
                Options +Indexes
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

I enabled it with sudo a2ensite share_backup_folder and restart apache2 sudo systemctl restart apache2 with no errors.

When I wget vpsxxxxx.ovh.net:8080/backup/example_file.tar.gz it fails with Connection refused

What am I missing here?

Thank you.

Score:0
cn flag

You probably miss a

Listen 8080

and it prbably belons into /etc/apache2/ports.

nz flag
That was it! Thank you!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.