Host my website

Hardware: VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / …
YunoHost version: Latest one
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen | …
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Hi!

I have just installed a Yunohost instance and I would like it to host my own website (built with a static site generator).
I am not familiar with nginx or web hosting, and I don’t know what I have to do. I would like my website to be shown in the default domain.

Now when putting the IP address of my instance in the browser, it takes me to the Yunohost administration webpage.

By the way, why do I see the administration webpage directly? Shouldn’t I see the SSO webpage? How do I access the SSO webpage?

First, you have to add a domain for your server in the webadmin > domains >add domain.
Check the diagnosis to see if there is anything you need to change in your registrar dashboard.
When you visit your domain name you will see the portal.
You have to add a domain for your website (a subdomain or the main domain, but you’ll have to create a subdomain for the portal)
Install the custom_webapp in that domain, it will give you sftp access to upload your website.

If you detail what you have done so far, it will be easier to guide you.

2 Likes

Thank you @jarod5001

I followed your suggestion to see the portal. It took me a looong while, but I finally made it, everything is normal now, thanks!

So, back to the main problem… Now I have my default domain, no subdomain and no app installed. I don’t understand what steps I should take to have my own website published in my default domain.

By the way, I would also like to show it from the www subdomain, so I guess I should start by adding a new subdomain: www. Is that correct?

And then, should I install that custom_webbapp app in the default domain or in the www domain? Or maybe in both?

Is there any documentation on how to configure this custom_webapp? I’m not familiar with webservers.

And once my website is up, what would I have to do to access the portal and the webadmin?

you see your portal, great! what domain are you using to access your ynh portal?

You can NOT use the SAME domain for both your website and your portal. So:

  • go to your webadmin portal (administration) and add there one domain (or subdomain) for your portal AND make it “default”, so it will be use as “yunhost portal for your server”. I presume you already have done this, because you can see your portal. https://first.domain will serve your portal.

  • add a domain (or a subdomain) that you will use to serve your website. https://second.domain

  • go to apps section (in your webadmin portal) and install https://github.com/YunoHost-Apps/my_webapp_ynh IN THE SECOND domain you have added.

  • you will have access to a new created directory (configured by installer) where you have to put your .html (or whatever files) you want to publish (/var/www/my_webapp/). Write a “hello world” index.html file just for testing.

  • in your web browser go to http://second.domain and index.html file should be shown

  • you can add “www” subdomain or config this as a redirect to main domain in your register

  • install certificate to serve https:// if you wanted (recomended)

edit: first.domain and second.domain are just examples, use your own domains or subdomains. These could be:

  • domain.tld for website
  • portal.domain.tld for yunohost portal access (set as default in webadmin)
1 Like

Thank you @ghose,

I think one of my problems was that I did not really understand what a default domain was, despite being clearly stated at the webadmin interface! Now I see it is just where the user SSO portal and the webadmin is.

Anyway, I’m afraid that was not my only misunderstanding, I must have more of those… Let me explain where I am now:

I added the subdomain portal.domain.tld and made it the default one. Then I installed the Custom Webapp at domain.tld. So my expectations now are that I should be able to visit my website at domain.tld and see the SSO portal at portal.domain.tld. Please correct me if my expectations are wrong.

Now when I tell the browser to take me to domain.tld, it shows me a “Did Not Connect: Potential Security Issue” warning and also says I cannot access portal.domain.tld because my site has a security policy called HTTP Strict Transport Security (HSTS).

Any suggestion on what to do? I have a valid Let’s Encrypt certificate.

After that, while checking the diagnosis tool, I noticed the XMPP and mail DNS records had changed to the portal.domain.tld subdomain.

How could I move the mail and XMPP servers back to the parent domain while keeping the SSO user and webadmin interfaces at the portal.domain.tld subdomain?

every domain you have in your server must have its own letsencypt certificate. so you have to go to domains > portal.domain.com > install letsenc certif (you can check certif validation also).
about xmpp and mail they are activated for all of your domains. in domains > yourdomain > domain configuration , you’ll find where to enable or diable them for every domain.

Hey @jarod5001

Certificates said they were ok, but they were not, I reinstalled them and now I don’t get that HSTS warning any more. So thank you!

I have also been able to configure mail and XMPP per domain, thank you!

Now the problem is both portal.domain.tld and domain.tld takes me to the SSO user portal.

When visiting domain.tld, souldn’t I see an index.html webpage because I installed Custom Webapp?

when installing the custom_webapp, where did you install it? note that you must specify the domain and the path, in your case the path is “/”
to check where you installed it, go to apps > custom webapp, and see what’s the path. if it’s not what you wanted, just delete that app and install a new one or change the path.
another thing is permissions (in users > groups and permissions), your webapp must be accessible by visitors (if you want it that way, otherwise none can access it without an account and the proper permissions)

I installed it at domain.tld/site, that was the default.

Oh, yes! That was the problem! Now it works!! Thanks!

And now I have changed the path from /site to / and I finally se a webpage when visiting my domain.tld

Thanks again @jarod5001 and @ghose

2 Likes

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