Score:0

Web server on Ubuntu core 22

hk flag

I started development for ubuntu core. I want to host my php web app on the ubuntu core. The problem is that it is snap based OS an I can't install apache2 and other packages what i need to host my webpage. Can you offer a snap to host php web apps or there is any way to install apache2 on Ubuntu core?

Artur Meinild avatar
vn flag
I think the easiest way is to install Docker, and then run the Webserver as a Docker container.
cn flag
"Can you offer a snap to host php web apps or there is any way to install apache2 on Ubuntu core?" wrong place to ask; we are users just like you; if we could do this so could you :)
in flag
Ubuntu Core is targeted for IoT and embedded devices. Is there any particular reason why Ubuntu Server can't be used to host the site?
Grabowsky avatar
hk flag
@matigo It is a good way for me but i need to run gtk gui apl on the device and i tried to use ubuntu frame on ubuntu server. i installed it and run but i have no idea how to run a simple gnome-mastermind(find it in a ubuntu frame tutorisl) gtk app on the screen. When i try to run it i got error message: gtk cannot open display: . I tried a lot of options but i didn't find solution. The reason is why i dont use ubuntu desktop because a want to save resources.
user535733 avatar
cn flag
Please [edit your question](https://askubuntu.com/posts/1469346/edit) to add new information and improve your question. Comments are intended to help you improve your question until it is answerable. Comments are not intended for conversation.
Artur Meinild avatar
vn flag
Considering your [other question](https://askubuntu.com/questions/1469373/ubuntu-frame-on-ubuntu-server), why don't you go forward with Ubuntu Frame on Ubuntu core right here?
uz flag
Jos
Considering requirements from both questions, I don't see a GUI app and Apache2 running together on anything other than Ubuntu Desktop. Not Server, not Core.
Score:0
hk flag

@ArturMeinild thank you for your recommendation. It seems the best way to use docker. I find some tutorials with which anyone can start to implement web-server on ubuntu core. some help to start:

  1. Download the Apache Image for Docker

    docker pull httpd
    
  2. Start the Apache Container

    docker run -d --name [container-name] -p 80:[host-port] httpd 
    docker run -d --name apache -p 80:80 httpd
    
  3. type this in your browser: http://localhost:[host-port]

  4. to stop it

    docker stop [container-name-or-id]
    

thx for your answers.

TommyPeanuts avatar
cn flag
Hi - you're encouraged to write up the solution in your answer rather than link to solutions on 3rd party sites. Those sites can go down and render your answer useless.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.