Adding httpd in Yocto image

I am trying to build a Yocto image with apache server.
I added the following to my bblayers.conf file:

IMAGE_INSTALL += " apache2 curl"

And also changed the BBLAYERS :

BBLAYERS ?= "

${TOPDIR}/…/layers/meta-openembedded/meta-webserver

"

I see that when I flash the image and boot the target, there is no httpd binary file in the system.
There are no apache2 files on the disk.

I tried to install it on the disk, but it gives me a failure:

root@verdin-imx8mp-15230054:/# opkg update
root@verdin-imx8mp-15230054:/# opkg install apache2

  • opkg_prepare_url_for_install: Couldn’t find anything to satisfy ‘apache2’.
    root@verdin-imx8mp-15230054:/# opkg install httpd
  • opkg_prepare_url_for_install: Couldn’t find anything to satisfy ‘httpd’.
    root@verdin-imx8mp-15230054:/# opkg install apache
  • opkg_prepare_url_for_install: Couldn’t find anything to satisfy ‘apache’.

On the target, I don’t find apache2 in installed packages as well:

root@verdin-imx8mp-15230054:/# opkg list-installed | grep -i apache
root@verdin-imx8mp-15230054:/# opkg list-installed | grep -i httpd
libmicrohttpd12 - 0.9.76-r0

What did I miss to do?
I need to start an apache server via httpd

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To successfully add the Apache server (httpd) to your Yocto image, please follow these steps to troubleshoot and resolve the issue:

  1. Verify Layer Inclusion: Ensure that the meta-openembedded/meta-webserver layer is correctly included in your bblayers.conf. Confirm that the path is accurate and the layer is properly cloned into your Yocto build environment. You can use the command bitbake-layers show-layers in your Yocto build directory to list all included layers and verify the presence of meta-webserver.

  2. Check Image Recipe: Make sure the apache2 package is included in the image recipe you are building. Verify that the line IMAGE_INSTALL += "apache2 curl" is present in your local.conf or the specific image recipe file. Ensure that your custom image recipe is correctly referenced in the build process.

  3. Rebuild the Image: After confirming the above configurations, rebuild your image to incorporate all changes. Use the command bitbake <your-image-name>, replacing <your-image-name> with the actual name of your image.

  4. Monitor Build for Errors: During the build process, watch for any errors or warnings related to the apache2 package. These will be displayed in the console output and can help identify issues with fetching or compiling the package.

  5. Verify Package Availability: Once the image is built and flashed, check if the apache2 package is available on the target device by running opkg list-installed | grep apache. If the package is not listed, it indicates it was not included in the image.

  6. Check Package Management: If opkg cannot find the apache2 package, ensure your package feeds are correctly set up. You may need to update the feeds or verify the configuration of your package management system.

By following these steps, you should be able to identify and resolve the issue with adding the Apache server to your Yocto image.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

Installing Apache via Yocto.

Sorry, i was flashing wrong image on the target.
It worked.