Basic quesion: putting my HTML page online

Hello everyone. I’m completely new to servers and Yunohost. Is it possible to put an HTML page online without installing Wordpress or anything similar? Maybe by putting it in a specific directory?

Hi
Welcome to Yunohost.

Yes you can by installing my_webapp package.

Install it by admin web-interface or by this command:

$ yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh

Chose the domain, path , mysql database (if you need the mysql database) and the sftp password so that you can put the html files by sftp.

After install, sftp to the director and remove the index.html and put your files there.

2 Likes

Thanks, almost there. When trying to put my page on the server sftp tells me remote open("/var/www/my_webapp/www/homepage.html"): Permission denied. Should I run sftp from my local machine with sudo or how do I get around this?

Hi @Poyu ,

You can use Filezilla with your domain.name/site (sftp), user : webapp1, password : the one you’ve chosen

ppr

Thanks ppr. I’ve been trying to connect for a while now but no luck. Connecting to the server with my ordinary user works fine but with webapp1 I’m told “Error: Authentication failed.”. I’ve tried both with FileZilla and the sftp program itself. Pretty sure I have the right password. I even reinstalled my_webapp with a new password to make sure it wasn’t that. And changed it again with the passwd command which double-checks the spelling.

The error messages are these two:

|Error:|Authentication failed.|
|---|---|
|Error:|Critical error: Could not connect to server|

so I’m guessing it’s a kind of “wrong-password” message, right?

Have you changed the ssh port or disabled password for ssh? What do you mean by connecting with my ordinary user works? Only the admin user have the access to the ssh by default. It would be nice if you can show the filezilla screenshot.

Anyways you can transfer file through ssh(admin account) from your home computer or server if the webapp1 authentication is not working.

Ah, yes that’s true! I did take most of the security measures recommended on the website. I have already tried with the port I opened but it still didn’t work (and besides, port 22 doesn’t seem to get closed even with yunohost firewall disallow).

The ordinary user I’m talking about is the one I usually log into the server with (disabled admin per the recommendation).

I went over it again and noticed webapp1 wasn’t among the allowed users in sshd_config. Is it safe to add other users here? I added webapp1 for now and can indeed connect.

Open you ssh config file again. You will see these lines in the end.

# Harden SSH connection for the user
##-> webapp1
# Hardening user connection
Match User webapp1
  ChrootDirectory %h
  ForceCommand internal-sftp
  AllowTcpForwarding no
  PermitTunnel no
  X11Forwarding no
##<- webapp1

Add this line PasswordAuthentication yes line in it.

# Harden SSH connection for the user
##-> webapp1
# Hardening user connection
Match User webapp1
  ChrootDirectory %h
  ForceCommand internal-sftp
  AllowTcpForwarding no
  PermitTunnel no
  X11Forwarding no
  PasswordAuthentication yes
##<- webapp1

Restart ssh and use the changed port to login.
so now:
username: webapp1
password: you provided at the time of installation
port: changed port in ssh configuration, default was 22

eg. of sftp in file manager
sftp://webapp1@domain.tld:port

1 Like

Thanks, that solves it (provided that I also have AllowUsers webapp [other allowed users] in sshd_config). I’m still wondering why logging in with the SSH key I created doesn’t work though. :face_with_raised_eyebrow:

SSH is not allowed for this user. But you can play around with configuration to make this happen.