If you configure your server directly as root, don’t forget to remove sudo from each command.
If you set a password for the root account, the sudo command won’t be accepted.
Connect directly as root to execute commands.
You can also reinstall your system leaving the root password empty during installation. sudo will install and work properly.
➡️ To have the necessary modules, you need to install nginx in its complete version:
Terminal window
sudoaptupdate&&sudoaptinstallnginx-full
It’s done! Your site is accessible in your browser at the address http://IP_of_your_machine
# as directory, then fall back to displaying a 404.
try_files$uri$uri/=404;
}
location^~/webdav{
auth_basic"realm_name";
auth_basic_user_file/var/www/.auth.allow;
alias/var/www/html;
autoindexon;
autoindex_exact_sizeon;
autoindex_localtimeon;
indexfile.html;
dav_methodsPUTDELETEMKCOLCOPYMOVE;
dav_ext_methodsPROPFINDOPTIONS;
dav_accessuser:rw;
client_body_temp_path/var/www/tmp;
client_max_body_size0;
create_full_put_pathon;
}
}
Ligne 1-3 The server listens on port 80.
Ligne 5 Defines the path of the root of the internet site (or where your index.html is, for example).
Ligne 18location ^~ /webdav { says that to reach /var/www/html I enter the ip or the name of my machine + /webdav = http://172.16.30.30/webdav for example.
Ligne 20 Defines the path of the authentication file.