Group: Member
Post Group: Working Newbie
Posts: 74
Status:
|
Unless this already exists and I'm just not able to find it. I would propose that you have an Apache VirtualHost template some where - maybe: /var/webuzo/templates/apache-virtualhost.conf
With the VirtualHost data in a template format:
Code <VirtualHost %ip%:80>
<IfModule security2_module>
SecRuleEngine Off
</IfModule>
<IfModule suexec_module>
<IfModule !mod_ruid2.c>
SuexecUserGroup %user% %user%
</IfModule>
</IfModule>
<IfModule ruid2_module>
RMode config
RUidGid %user% %user%
</IfModule>
ServerName %domain%
ServerAlias www.%domain%
DocumentRoot /home/%user%/public_html
<FilesMatch \.(php|phtml)$>
<If "-f %{REQUEST_FILENAME}">
SetHandler "proxy:unix:/usr/local/apps/php73/var/fpm-%user%.sock|fcgi://localhost"
</If>
</FilesMatch>
<IfModule alias_module>
ScriptAlias /cgi-bin/ /home/%user%/public_html/cgi-bin/
</IfModule>
ServerAdmin %email%
ErrorLog /usr/local/apps/apache2/logs/%domain%.err
CustomLog /usr/local/apps/apache2/logs/%domain%.log combined
</VirtualHost>
Such that when you take the input from adding a user, you can add the VirtualHost entry with:
cat /var/webuzo/templates/apache-virtualhost.conf | sed s/%user%/$user/g | sed s/%domain%/$domain/g | sed s/%email%/$email/g >>/usr/local/apps/apache2/etc/conf.d/webuzoVH.conf
This would allow individual administrators to modify the Apache template to better suit their own needs.
|