Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Surfer
  3. What does it take to use Surfer as a “real” multidomain surfer?

What does it take to use Surfer as a “real” multidomain surfer?

Scheduled Pinned Locked Moved Surfer
19 Posts 9 Posters 972 Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jamesJ Offline
    jamesJ Offline
    james
    Staff
    wrote on last edited by
    #2

    Hello @luckow
    Indeed, I found nothing in the documentation for surfer https://docs.cloudron.io/packages/surfer/ regarding "real" multidomain hosting.
    I will relay this question, and hopefully it can be answered soon.

    1 Reply Last reply
    1
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #3

      I guess we have to implement this . In conversation in the past, @nebulon was reluctant to make surfer as some advaced Apache/nginx. I think he thought it was slippery slope to add vhost to Surfer and then we have to implement all the apache/nginx vhosting options .

      If you want vhosting, have you considered LAMP app? You can then set up a apache config to route serving of pages to whichever subdirectory you want . I think @robi had a config for this some time ago.

      1 Reply Last reply
      2
      • girishG girish marked this topic as a regular topic on
      • luckowL Offline
        luckowL Offline
        luckow
        translator
        wrote on last edited by
        #4

        I really like using Surfer for static websites. It's a nice little thing that does one job brilliantly. The reality is that I have a lot of domains with few pages and little traffic. Installing an instance of Surfer for each domain is not viable. If there is currently no option for multidomain, I will temporarily switch to LAMP because of the configuration options with RewriteEngine. The moment Surfer has the multidomain feature built in, I'll switch back (because of the fat stack in LAMP, which I don't need).

        Pronouns: he/him | Primary language: German

        andreasduerenA 1 Reply Last reply
        4
        • luckowL luckow

          I really like using Surfer for static websites. It's a nice little thing that does one job brilliantly. The reality is that I have a lot of domains with few pages and little traffic. Installing an instance of Surfer for each domain is not viable. If there is currently no option for multidomain, I will temporarily switch to LAMP because of the configuration options with RewriteEngine. The moment Surfer has the multidomain feature built in, I'll switch back (because of the fat stack in LAMP, which I don't need).

          andreasduerenA Offline
          andreasduerenA Offline
          andreasdueren
          wrote on last edited by
          #5

          @luckow +1. Use surfer for lots of static, low traffic sites. It's great!

          1 Reply Last reply
          3
          • nebulonN Away
            nebulonN Away
            nebulon
            Staff
            wrote on last edited by
            #6

            @luckow what is the main issue to not install distinct surfer apps for each domain, if they serve up different content anyways? the surfer app container should be very low on memory usage, disk images are anyways shared and cpu wise it also wouldn't register for low-traffic.

            Is this maybe a UI issue where it gets confusing in the dashboard or login wise into 10s of surfer instances?

            humptydumptyH luckowL 2 Replies Last reply
            2
            • nebulonN nebulon

              @luckow what is the main issue to not install distinct surfer apps for each domain, if they serve up different content anyways? the surfer app container should be very low on memory usage, disk images are anyways shared and cpu wise it also wouldn't register for low-traffic.

              Is this maybe a UI issue where it gets confusing in the dashboard or login wise into 10s of surfer instances?

              humptydumptyH Offline
              humptydumptyH Offline
              humptydumpty
              wrote on last edited by
              #7

              @nebulon True. Resource wise, surfer is very minimal. I have like 5 surfer apps, RAM idles around 50-80MB and 0.1% CPU if that, lol. It would be nice to have them all consolidated for a cleaner UI. Surfer is awesome. Thanks for creating it, Johannes!

              1 Reply Last reply
              1
              • nebulonN nebulon

                @luckow what is the main issue to not install distinct surfer apps for each domain, if they serve up different content anyways? the surfer app container should be very low on memory usage, disk images are anyways shared and cpu wise it also wouldn't register for low-traffic.

                Is this maybe a UI issue where it gets confusing in the dashboard or login wise into 10s of surfer instances?

                luckowL Offline
                luckowL Offline
                luckow
                translator
                wrote on last edited by
                #8

                @nebulon Thank you for your question. I spent a moment thinking about my “true motivation”. In the end, it's more of a UI issue. 10 applications for lame static web pages. Some of them with only one html file. As for resources, I'm totally with @humptydumpty. Lol.
                But I feel a bit stressed when I see 10 apps that mean nothing to me. They only exist because of that one html file. They interfere with my daily life as an admin on one Cloudron instance.
                On another Cloudron instance I have only one tile: LAMP called multisite and that feels more comfortable.

                Pronouns: he/him | Primary language: German

                andreasduerenA 1 Reply Last reply
                1
                • luckowL luckow

                  @nebulon Thank you for your question. I spent a moment thinking about my “true motivation”. In the end, it's more of a UI issue. 10 applications for lame static web pages. Some of them with only one html file. As for resources, I'm totally with @humptydumpty. Lol.
                  But I feel a bit stressed when I see 10 apps that mean nothing to me. They only exist because of that one html file. They interfere with my daily life as an admin on one Cloudron instance.
                  On another Cloudron instance I have only one tile: LAMP called multisite and that feels more comfortable.

                  andreasduerenA Offline
                  andreasduerenA Offline
                  andreasdueren
                  wrote on last edited by
                  #9

                  @luckow said in What does it take to use Surfer as a “real” multidomain surfer?:

                  In the end, it's more of a UI issue

                  Second this. One surfer instance for these things is just much easier to monitor too.

                  1 Reply Last reply
                  1
                  • jamesJ Offline
                    jamesJ Offline
                    james
                    Staff
                    wrote on last edited by
                    #10

                    So an order and folder function for app elements in the dashboard would be the feature request I guess.
                    Having the ability to stuff "background" apps like Synapse, Valheim or TeamSpeak into a folder and forget about it.
                    Same with the 10x Surfer problem. All into a folder. Out of sight, out of mind.

                    luckowL humptydumptyH timconsidineT 3 Replies Last reply
                    2
                    • jamesJ james

                      So an order and folder function for app elements in the dashboard would be the feature request I guess.
                      Having the ability to stuff "background" apps like Synapse, Valheim or TeamSpeak into a folder and forget about it.
                      Same with the 10x Surfer problem. All into a folder. Out of sight, out of mind.

                      luckowL Offline
                      luckowL Offline
                      luckow
                      translator
                      wrote on last edited by
                      #11

                      @james said in What does it take to use Surfer as a “real” multidomain surfer?:

                      Out of sight, out of mind.

                      😳

                      Pronouns: he/him | Primary language: German

                      1 Reply Last reply
                      2
                      • jamesJ james

                        So an order and folder function for app elements in the dashboard would be the feature request I guess.
                        Having the ability to stuff "background" apps like Synapse, Valheim or TeamSpeak into a folder and forget about it.
                        Same with the 10x Surfer problem. All into a folder. Out of sight, out of mind.

                        humptydumptyH Offline
                        humptydumptyH Offline
                        humptydumpty
                        wrote on last edited by humptydumpty
                        #12

                        @james Maybe this could be useful resource wise too. IDK if it works this way, perhaps a dev can explain but if each surfer app idles at +50MB. Would stacking all the sites on a single surfer app bring down the overall RAM usage? For example, 50 MB RAM x 10 surfer apps = 500 MB vs. having them stacked in a single surfer app that would have 50MB RAM usage only. Food for thought. If it's the latter, then any cheap hosting plan could work for basic sites/businesses.

                        1 Reply Last reply
                        1
                        • jamesJ james

                          So an order and folder function for app elements in the dashboard would be the feature request I guess.
                          Having the ability to stuff "background" apps like Synapse, Valheim or TeamSpeak into a folder and forget about it.
                          Same with the 10x Surfer problem. All into a folder. Out of sight, out of mind.

                          timconsidineT Online
                          timconsidineT Online
                          timconsidine
                          App Dev
                          wrote on last edited by
                          #13

                          @james said in What does it take to use Surfer as a “real” multidomain surfer?:

                          folder function for app elements in the dashboard

                          Hey, now you're on to something.
                          Folders would be great and serving multiple needs
                          For me personally the dashboard filter doesn't really hit the mark.
                          Yes, it does work, so no complaints.

                          But having a folder which I could put all apps for a domain, now that would really help overcome "can't see wood for trees" syndrome. I have 130 apps deployed.

                          In some cases I might want to group apps by ephemeral criteria not available in dashboard filters, such as "fringe".
                          Tags go some way to this, but a folder would be neat.

                          1 Reply Last reply
                          4
                          • nebulonN nebulon referenced this topic on
                          • rosanoR Offline
                            rosanoR Offline
                            rosano
                            wrote last edited by
                            #14

                            I just worked on a hack for this https://github.com/rosano/remit

                            It's a small separate app that maps multiple domains to folders under any public URL: so if it gets a request for your-site-domain.com/path, it will fetch https://your-surfer-cloudron-domain.com/maybe_a_folder_with_some_websites/your-site-domain.com/path and send it as a response. So you name folders with the domain and it figures out the rest.

                            1 Reply Last reply
                            0
                            • nebulonN Away
                              nebulonN Away
                              nebulon
                              Staff
                              wrote last edited by
                              #15

                              I think what you really want here is a location rewriting reverse proxy. Maybe apache mod_rewrite using the lamp app would work here. Given the generic nature of (sub)domains mapping to paths, I guess in the end everything ends up as a hack unless there is a proper regular expression syntax supported.

                              (a propery reverse proxy is required as unlike that remit hack, you also need to handle all HTTP verbs like POST, PUT,.... as well as dealing at least with header and status code forwarding)

                              rosanoR 1 Reply Last reply
                              0
                              • nebulonN nebulon

                                I think what you really want here is a location rewriting reverse proxy. Maybe apache mod_rewrite using the lamp app would work here. Given the generic nature of (sub)domains mapping to paths, I guess in the end everything ends up as a hack unless there is a proper regular expression syntax supported.

                                (a propery reverse proxy is required as unlike that remit hack, you also need to handle all HTTP verbs like POST, PUT,.... as well as dealing at least with header and status code forwarding)

                                rosanoR Offline
                                rosanoR Offline
                                rosano
                                wrote last edited by
                                #16

                                @nebulon Agreed. I just use the tools I understand, so it tends to end up with this shape. For me static sites only require GET anyway. I copied headers in the previous version, maybe will add that later. Pull requests welcome if someone wants to improve it.

                                1 Reply Last reply
                                0
                                • robiR Offline
                                  robiR Offline
                                  robi
                                  wrote last edited by
                                  #17

                                  One could also do it in the reverse, but having your Surfer app with several sites in subfolders, then install an App Proxy for each subfolder.

                                  The issue is you now have a lot of App Proxies in your dash which is just like all the Surfer apps..

                                  Since we don't have better control over the Cloudron reverse proxy, having more features in the App Proxy would make sense.

                                  @nebulon what do you think about bringing it into the Services section of Cloudron which would allow us to add an arbitrary number of proxy records all in one place?

                                  Or it could filter down into the Location section of App Config with Aliases and Redirects, which could then support ports and paths.

                                  Conscious tech

                                  1 Reply Last reply
                                  0
                                  • timconsidineT Online
                                    timconsidineT Online
                                    timconsidine
                                    App Dev
                                    wrote last edited by timconsidine
                                    #18

                                    I think it is possible to write a simple nodejs app which handles the proxy.
                                    One surfer instance, one nodejs app in it started on launch, multiple folders/sites.

                                    1 Reply Last reply
                                    0
                                    • robiR Offline
                                      robiR Offline
                                      robi
                                      wrote last edited by
                                      #19

                                      Not sure you even need that, as I recall writing some JS for a list of redirects based on the incoming request which could send you anywhere else as part of the index.html on a Surfer App.

                                      The main issue I think was URL cloaking so the address bar doesn't change, while the content of the page does.

                                      Conscious tech

                                      1 Reply Last reply
                                      1
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Bookmarks
                                      • Search