[SOLVED] Can't copy directory to custom web app + app not working/responding

Hardware: VPS bought online ( Contabo )
YunoHost version: 11.1.0.2 (stable)
I have access to my server : Through SSH and browser
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

hi!
im trying to add a static website made with hugo on my server through the custom web app by copying the hugo directory into the directory the app tells me to, but i encounter an error:

:~$ sudo scp -rP *new posrt* ~/quickstart me@my.domain:/var/www/my_webapp/www
[sudo] password for me:          
Debian GNU/Linux 11
me@my.domain's password: 
scp: /var/www/my_webapp/www: Permission denied

i get permission denied even though im copying it as sudo.
what’s wrong?
what can i do to make it right?

sudo su
And don’t forget to fix files ownership.

it gives me this error

su: invalid option -- 'r'
Try 'su --help' for more information.

interference from the -rP of scp?

done.

i copied the directory in a temp directory and then moved it to /var/www/my_webapp/www with mv (using root) as the app says to do, but when i refreshed the page it still loads on the my_webapp page. :cry:

what im trying to do specifically is to put up my hugo website and, as i think it is being suggested in this thread, the only thing i need to do is to create the website and then upload it in the my_webapp directory.

or ma i wrong?

You have instructions in my_webapp’s README and default index page to transfer data in the www directory.

Namely, if you have enabled the SFTP access of the app, you can use the my_webapp user to transfer files.

the instructions simply say to transfer data in the www directory (which i’ve done) and there is no mention of the default index page.

the app also says that

First way to edit this site is by putting your files in /var/www/my_webapp/www using SSH/SCP.

and that’s what i’ve done.

are you saying that, actually, SFTP is the only way to transfer data and make it work?

are you saying that, actually, SFTP is the only way to transfer data and make it work?
No, you can drop files in there. I use this app, too. i don’t use scp. i copy files from nextcloud to this folder and change owners.

what is the ownership of the files?
www-data should be the group. Here is my example:

I did this after moving my files:
chown -R bob:www-data /var/www/my_webapp/

Then my /var/www/my_webapp/ looks like this

root@server:/var/www/my_webapp/www# ls -la
total 1576
drwxr-x---   16 bob www-data    4096 Sep 20 15:01 .
drwxr-x---+   3 bob www-data    4096 Jan 14  2022 ..
-rw-r-----    1 bob www-data    7546 Jan  1 22:58 404.html
drwxr-x---    2 bob www-data    4096 Jul 12 22:55 about-arkadi-cloud
drwxr-x---    2 bob www-data    4096 Jul 12 22:55 about-hugo
drwxr-x---    2 bob www-data    4096 Jul 12 22:55 about-us
drwxr-x---    2 bob www-data    4096 Jul 12 22:55 archives

i can’t understand this sentence.

anyway, i did what you said with chown, but it is still not working.

just to show you:

root@me:/var/www/my_webapp/www# ls -la
total 16
drwxr-xr-x   3 me www-data 4096 Jan  8 20:52 .
drwxr-x---+  3 me www-data 4096 Dec 31 03:18 ..
-rw-r-----   1 me www-data 1094 Dec 31 03:18 index.html
drwxr-xr-x  11 me www-data 4096 Jan  9 00:42 quickstart

quickstart is the the basic website you build by following the getting started guide from hugo.

hmm ok, owners looks right. then my last hunch would be permissions for the whole folder.

chmod -R 755 /var/www/my_webapp/www/

other than that, you might need to check the github page for that app.

You need to do, separately:

sudo su

Then you type your command, on another line:

scp -rP *new post* ~/quickstart me@my.domain:/var/www/my_webapp/www

That’s only for the copy command. The permissions are another problem.

1 Like

didn’t work, i might just open an issue then.
thank you very much for the help.

that still doesn’t work :cry:

This is my hugo website

root@home /v/w/m/www# ls -la                     total 556
drwxr-xr-x  15 my_webapp www-data   4096  6 mars   2022 ./
drwxr-x---+  3 root      root       4096 14 janv.  2022 ../
-rwxr-xr-x   1 my_webapp www-data  12614  1 févr.  2022 404.html*
drwxr-xr-x   8 my_webapp www-data   4096  1 févr.  2022 categories/drwxr-xr-x   2 my_webapp www-data   4096  8 févr.  2022 com/drwxr-xr-x   3 my_webapp www-data   4096 17 janv.  2022 contact/
drwxr-xr-x   5 my_webapp www-data   4096 17 janv.  2022 contact2/
drwxr-xr-x   5 my_webapp www-data   4096 17 janv.  2022 contact3/
drwxr-xr-x   2 my_webapp www-data   4096  1 févr.  2022 css/drwxr-xr-x   2 my_webapp www-data   4096  1 févr.  2022 fonts/
drwxr-xr-x   3 my_webapp www-data   4096  1 févr.  2022 images/
drwxr-xr-x   2 my_webapp www-data   4096  1 févr.  2022 img/-rwxr-xr-x   1 my_webapp www-data  37142  1 févr.  2022 index.html*
-rwxr-xr-x   1 my_webapp www-data  15987  1 févr.  2022 index.xml*
drwxr-xr-x   2 my_webapp www-data   4096  1 févr.  2022 js/
drwxr-xr-x   4 my_webapp www-data   4096  1 févr.  2022 page/
drwxr-xr-x  21 my_webapp www-data   4096  1 févr.  2022 posts/
-rw-r--r--   1 my_webapp www-data 417977  6 mars   2022 prober.php
-rwxr-xr-x   1 my_webapp www-data  10107  1 févr.  2022 sitemap.xml*
drwxr-xr-x  54 my_webapp www-data   4096  1 févr.  2022 tags/

So all the files and folders should be owned by “my_webapp” not “me” or anything else.

Shouldn’t you simply follow those instructions?

Hi,

I have two websites in two separates my_webapp folders ( a blog and a Minigalnano photo website).

I upload my Hugo site using the rsync deploy functionality: Deployment with Rsync | Hugo which is very handy.

However I also sometimes upload using Filezilla.

You should only upload the files that are in the “public” folder of your generated Hugo website.

It should contain an index.html file.

So, I suggest you to first delete all the files in your www folder in Yunohost, then upload the files in the “public” folder to the www folder.

2 Likes

it worked.
and your explaination was super clear.
thank you very much for your help. :heart:

1 Like

Also, in your Hugo conf file (I am using a config.toml file), can you check that you specify the:
baseURL = ‘https://xxxx/’ at the begining. It should be the adress of your website (not of Yunohost).

1 Like

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