Score:0

Help with accessing nextcloud instance from web browser by using domain name

at flag

Ubuntu Version: Ubuntu 20.04.3 LTS

Nextcloud Version: nextcloud 23.0.0

Apache version: 2.4.41

I am trying to setup a nextcloud instance on my linux server. However when i try to access it from the web browser(firefox) by typing server.swayamshree.com I am getting the message:

Forbidden

You don't have permission to access this resource.

Apache/2.4.41 (Ubuntu) Server at server.swayamshree.com Port 80

Any help will be deeply appreciated. I have listed the details of my configuration below.

The folder for my nextcloud instance is located at /media/swayam/external/server.swayamshree.com with the following permissions:

drwxr-xr-x 13 www-data www-data 4096 Nov 26 15:54 server.swayamshree.com

The file located at /etc/apache2/sites-available/server/swayamshree.com.conf has the following content:

 <VirtualHost *:80>
 ServerAdmin webmaster@localhost
 DocumentRoot "/media/swayam/external/server.swayamshree.com"
 ServerName server.swayamshree.com

 <Directory "/media/swayam/external/server.swayamshree.com/">
     Options MultiViews FollowSymlinks
     AllowOverride All
     Order allow,deny
     Require all granted
 </Directory>

 TransferLog /var/log/apache2/server.swayamshree.com_access.log
 ErrorLog /var/log/apache2/server.swayamshree.com_error.log
 </VirtualHost>

The appropriate content of the file located at /etc/apache2/apache2.conf is as follows:

...
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /media/swayam/external/server.swayamshree.com/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
...
Score:0
in flag

Apache, by default, is limited to the /var/www directory. As a result, you have two options to choose from:

  1. Create a mount point for your NextCloud installation that exists inside /var/www
  2. Modify the AppArmor profile, which limits Apache to the one directory, to allow read/write access to the external location

Both of these options are perfectly valid, though the first may be simpler.

SwayamShree avatar
at flag
Tried doing option 1. I am still getting the same error
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.