Troubleshooting Manual Package Creation


I am trying to make an apache httpd with mod_php package. I went through the build process for httpd and php and I can run the compiled httpd with the php module enabled no problem. Using ops pkg from-run only pulls in the output of ldd on httpd, it does not pull in the apache2 config files so I am putting that together manually. I used the eyberg/apache:2.4.48 package as a reference for which files I should include as that package does work.

Output of an ops pkg load --local apache_2.4.58:

user@ubuntu:~$ ops pkg load --local apache_2.4.58 --show-errors --accel=false
running local instance
booting /home/user/.ops/images/httpd ...
en1: assigned

As you can see it just exits and returns me to my prompt.
Running the same command with --missing-files only 1 file missing

user@ubuntu:~$ ops pkg load --local apache_2.4.58 --missing-files --accel=false
running local instance
booting /home/user/.ops/images/httpd ...
en1: assigned

If I create that file I get an apache error.

At this point I am comparing the configuration files in the eyberg/apache:2.4.48 package to my own but I cant seem to see aside from port numbers or the php files in my package. Changing my httpd.conf to not load the php module results in the same behavior so I’m not sure it can be isolated the inclusion of mod_php.

I noticed the httpd process spawns child processes if I run it locally which I know nanos only supports single processes. There is a configuration for apache that makes httpd run as a single process but use child threads. I checked the configuration on eyberg/apache:2.4.48' and it did not seem to be enabled either so I’m not really sure there either.

Ultimately I’m looking any ideas on troubleshooting this package and troubleshooting nanos packages in general. I did the --trace option but If I’m being honest, the output of that is not something I have experience with interpreting.

That’s correct child processes won’t work. If you look nside that package at ~/.ops/packages/eyberg/apache_2.4.48 an argument is passed:

   "Args" : ["httpd", "-DONE_PROCESS"],

If you paste the output of --trace it’ll more than likely show us what it might be failing on. Without looking I don’t know if mod_php would need a patch or not. If all you want to do is frontend php there might be better options but if you’re really interested in doing apache w/mod_php we can take a look at crafting a pkg for it.

I copied the manifest from your package for mine and still get this behavior. The only reason I am trying to use apache w/ mod_php is to do an apples to apples comparison of apache w/ mod_php running in a container vs unikernel and demonstrating the behavior of php command injection. Just for demonstration purposes, I know what the behavior will be.

my understanding of mod_php is that it enables httpd to load php as a .so and execute in threads and not child processes – on the surface it seemed like the way to go.

here is a gist of the trace: gist:98f4a9b451adbfdeeb13049954422bf4 · GitHub

I’ll take a look at creating a new pkg here in a bit, but this error message indicates that you need more disk space allocated:

(fsstatus:1 result:unable to create extent)

If you look in that package.manifest file you’ll find this line - you’ll just want to bump that up to whatever amount is necessary:

 "BaseVolumeSz": "32m",

I cut a new package for this:

which should allow you to run php from /usr/local/apache2/htdocs/ .

Thanks this worked perfect for my demonstration. I saw you basically included every module including mod_rewrite. That’s convenient as that was the next module I was going to try to get working.

1 Like