I can see several problems. Firstly the “command” section under apps/apache2snap should be the command to RUN the program, not the command to compile it. So it should look like this:
command: apachectl start
or something like that.
The source uses autotools (configure script) so you should be using the autotools plugin, not the nil plugin. Furthermore giving an absolute local path in your home directory for your source package is poor practice that WILL bite you, for example if you want to use cleanbuild etc. Either provide a URL for the source code, or extract the source archive and keep your snapcraft.yaml in the same directory. In the latter case, use “.” as your source path.
That means your “parts” section should look something like this:
Keep in mind that your snap will not work in non-devel mode because at the moment it lacks all the required plugs (at a minimum, network-bind will obviously be required).
Generally since obviously you just started learning, I would advise you to start with something easier. Building snaps for network services his HARD. How are you going to handle configuration? By default your /etc/ will be in a read-only location. You will need to make sure that it gets copied into $SNAP_COMMON upon first installation. Then you will need to make sure that Apache picks it from there and not from /etc. You will need to implement a mechanism so that the user can configure apache through snap set/snap get, which will need to regenerate the config files accordingly. You will have to manage the service life cycle. Etc.
If you completed the intro tutorial, why don’t you try something like “curl”, for example? It will be a good learning experience, slightly more complex than a hello world, but not by much. After that, try some daemon that kind of “just works” and doesn’t need much config, just start/stop etc. Apache, IMHO, is the ultimate destination of a long and difficult learning journey.