You seem pretty confused here ?
If you are using Ubuntu server with LAMP then you certainly do have Apache installed But anyway, you shouldn't be going anywhere near the Apache config files when you are installing a plugin module or Theme in Moodle.
Basically, in your Moodle code directory, look for the Folder for the Theme, or Plugin, etc. and change the permissions on that Directory (and all sub directories) to be Owned by Apache (user www-data on Ubuntu).
I tend to use a GUI (Webmin) but it's just as easy to do this with chmod on the CLI if that's what you prefer