EDIT Please see below for my resolution**
Okay so I was hardheaded for about 4 days trying to fix this problem on my own and I give up. I am sure this is quite simple but I cant do it and I would love if someone could enlighten me as to the procedure for fixing this.
I am running centos 5 on a multipurpose server. I have webmin/virtualmin installed for running a couple small websites. I already understand security risks etc… for facing asterisk internet blah blah blah. My problem is this:
I am creating virtual domains using virtualmin and then trying to install freepbx to the virtual domain. Now permission wise the domain is owned by say user1:user1 and of course freepbx insists that everything is owned by asterisk:asterisk now if I reconfigure amportal.conf and then run apply_conf.sh or amportal restart it messes up the permissions and tries to change apache to the asterisk user. So my amp site is not viewable (i.e. not permitted error) now if I chown all the directories including /var/run/asterisk /etc/asterisk /home/domain/pub/admin etc… back to the web user user1:user1 it works (in theory) but I am sure this is not the right way to do things. Now if I do like all the installation manuals direct and change the apache user to asterisk:asterisk then none of my websites run correctly.
Okay so to clarify what I am trying to do:
Install freePBX into a virtual domain that is pre setup via virtualmin. I have no problem changing the apache user to asterisk but I cant do it obviously if all my other websites are not going to work. I guess maybe I just am a little green in the users and groups comprehension of linux. I recently have made the committed plunge into linux and even went full console mode. I love it so far but as you can see there is a learning curve. Any help with this would be greatly appreciated.
***Well I figured it out after a bit of time even though I am pretty sure that my fix is most definitely not the right way to do it atleast I have it working. I deleted the domain / freepbx and then did a virtualmin virtual domain import using the asterisk user and group as owner. that way both were owned by asterisk without changing my main apache conf file users. I created both databases and did the import. Then I installed FreePBX to that Vdomain and voila! freepbx is running as asterisk and my already existing domains and hostings were not affected. Now my only concern is if there is any type of security issues that I need to be aware of. Anyone?