UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    runnig a webserver - no chance

    Scheduled Pinned Locked Moved Support
    31 Posts 12 Posters 7.3k Views 5 Watching
    Loading More Posts
    • 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.
      • dobeyD Offline
        dobey @Lakotaubp
        last edited by

        @Lakotaubp I don't think that will help, as what this person wants is clearly not UT, but traditional linux distro.

        LakotaubpL 1 Reply Last reply Reply Quote 1
        • LakotaubpL Offline
          Lakotaubp @dobey
          last edited by

          @dobey Your probably right but you never know. They have a rpi, maybe they might try UT on it and see what can be done with UT.

          1 Reply Last reply Reply Quote 0
          • flohackF Offline
            flohack @bforpc
            last edited by

            @bforpc Forgive me but what is the usecase to run a web server on a mobile device? It will be slow, it will be unreliable over WiFi and it will drain your battery.

            My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

            1 Reply Last reply Reply Quote 0
            • D Offline
              doniks @bforpc
              last edited by

              @bforpc said in runnig a webserver - no chance:

              Dear Group,

              I have tried the last 3 days without success. Apache is not running under libertine, nginx are running, but - no matter what the error is - it does not found any file in the web root directory.

              Only hint - no error - i found in debug logs of nginx are:

              2020/10/05 15:47:21 [debug] 9911#9911: *1 http script var: "/"
              2020/10/05 15:47:21 [debug] 9911#9911: *1 trying to use dir: "/" "/var/www/html/"
              2020/10/05 15:47:21 [debug] 9911#9911: *1 trying to use file: "=404" "/var/www/html=404"
              2020/10/05 15:47:21 [debug] 9911#9911: *1 http finalize request: 404, "/?" a:1, c:1
              2020/10/05 15:47:21 [debug] 9911#9911: *1 http special response: 404, "/?"
              
              

              I have tried also running the Web Servers from the root of the nexus 5 it self. This will be working - but breaks the system and then some apps (all web browsers) are not working annymore. morph browser crashes the hole system into a reboot.

              Is there a chance, to have ubport up and running and also a web server inkl. php?

              Bfo

              Let me try to eschew the philosophical conversation and have a technical one (and ducking my head while doing so;) ).

              Can you give more detail about what exactly you tried and what exactly was the result. I understand you installed apache in libertine?! which packages precisely, how did you configure it, start it, test it ...

              B 1 Reply Last reply Reply Quote 0
              • B Offline
                bforpc @doniks
                last edited by bforpc

                @doniks said in runnig a webserver - no chance:

                Let me try to eschew the philosophical conversation and have a technical one (and ducking my head while doing so;) ).

                Thats a very well nice suggestion.

                Can you give more detail about what exactly you tried and what exactly was the result. I understand you installed apache in libertine?! which packages precisely, how did you configure it, start it, test it ...

                Only some standards.
                Like described: If i install apache2, it will not start, because of some restrictions inside libertine - at this moment i cant remember. nginx is starting (the daemon), but no websites will be served out - Browser says alway: page not found, The nginx conf is standard, searching in webroot under /var/www/html - what has exist with content and all needed rights.
                Installed i have the packages with pkg install nginx php (and some other dependencys).

                In root of ubports i have try to install apache2 or nginx and mc, but - because of less storage in the roor dir, i moved /var/cache/apt and /usr/share/doc to the /userdir storage and linked it back. After that i install nginx what worked well...except for the small thing that the device no longer boots into the desktop - something was broken - yes yes yes ... i had read that, this can be happen and i dont care about it.It was a try.

                Bfo

                D 1 Reply Last reply Reply Quote 0
                • T Offline
                  tera
                  last edited by tera

                  @bforpc Have you tried lighttpd?
                  In my attempt to test MotionOS (using lighttpd if i'm not wrong...) in Libertine, i was able to access the Web UI in Morph: https://forums.ubports.com/topic/2570/help-needed-motion-eye-in-a-container?lang=en-GB

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    doniks @bforpc
                    last edited by

                    Only some standards.
                    Like described: If i install apache2, it will not start, because of some restrictions inside libertine - at this moment i cant remember.

                    Well, it's in the eye of the beholder what is standard ... I personally have no experience with apache, so I wouldn't have a clue what is standard .... well let me just try ... sudo apt install apache2 on my laptop and afterward go to http://localhost shows some default website. ha! that was easy. I somehow feared it was more difficult:) Ok, try again on my deb: libertine-container-manager install-package -p apache2 ... no, it doesn't like that

                    Setting up apache2 (2.4.18-2ubuntu3.17) ...
                    /bin/sh: 1: .: Can't open /etc/apache2/envvars
                    Could not read /etc/apache2/envvars
                    dpkg: error processing package apache2 (--configure):
                     subprocess installed post-installation script returned error exit status 2
                    

                    https://paste.ubuntu.com/p/MBKhfGTDjT/

                    Mhm. I guess you'd have to dig into whatever happens in "Setting up". I poked a little bit but .deb packages are still pretty much magic black boxes to me. I don't know where to find the setup code...

                    1 Reply Last reply Reply Quote 0
                    • joniusJ Offline
                      jonius
                      last edited by

                      Instead of using libertine you could put your server in your home directory and add an upstart service for it. Or create an unconfined app that does the very same, allowing you to use Clickable for compiling, adding dependencies and such.

                      B 1 Reply Last reply Reply Quote 0
                      • B Offline
                        bforpc @jonius
                        last edited by

                        @jonius
                        Hi,

                        can you explain a little bit more, how to do exactly that, what you described?

                        bfo

                        Z 1 Reply Last reply Reply Quote 0
                        • Z Offline
                          zykrates @bforpc
                          last edited by

                          @bforpc
                          Dear bforpc,

                          i tried the same with my Nexus 5 running on UT. I couldn't run

                          sudo apt install apache2
                          

                          directly, I got this message:

                          W: Es wird keine Sperre für schreibgeschützte Sperrdatei /var/lib/dpkg/lock-frontend verwendet.
                          W: Es wird keine Sperre für schreibgeschützte Sperrdatei /var/lib/dpkg/lock verwendet.
                          

                          as i learned this IS intentional: askubuntu/sudo-apt-get-install-is-showing-not-using-locking-for-read-only-file-var-lib read the Warnings. Soon after i run into some storage issues, however a soft reset of the phone didnt help. With minimal packages installed my intention worked but the wifi was unstable as well.

                          Now i even cant remove the packages anymore.

                          with:

                          sudo mount -o remount,rw /
                          

                          you can execute i.e. or more:

                          sudo apt install apache2
                          

                          the next try is to install apache2 on libertine and somehow let it run.

                          KenedaK 1 Reply Last reply Reply Quote 0
                          • KenedaK Offline
                            Keneda @zykrates
                            last edited by

                            @zykrates
                            You shoult not use apt in UT.
                            And now you should reinstall OS using ubports installer for avoiding further problems.

                            2015-2023 : Meizu MX4 ☠️⚰️✝️
                            2023-2024 : Nexus 5 ☠️⚰️✝️
                            2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
                            🇲🇫🇬🇧

                            Z 1 Reply Last reply Reply Quote 0
                            • Z Offline
                              zykrates @Keneda
                              last edited by

                              @keneda i tried to flash it last. It is funny, that the ubports installer didnt wont to reflash on Win10, but it worked on ubuntu

                              the storage issue was on /dev/loop0 and after flashing there is 282M again free space. If you use the space carefully it worked for me. I forgot this issue and tried to install more apps and then it crashed.

                              i try apache with libertine now

                              btw: every iot device (i.e. esp32) has some webserver capabilities. The power consumtion of the nexus 5 is below 0,5W (25mW in Standby)

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post