Very helpful! Thanks!
The exported file has Mac (CR) line breaks, so the whole document is understood as a single comment line and ignored.
sudo rm /Library/FileMaker\ Server/HTTPServer/conf/extra/httpd-vhosts.conf
sudo tr '\r' '\n' < ~/Desktop/httpd-vhosts.conf > /Library/FileMaker\ Server/HTTPServer/conf/extra/httpd-vhosts.conf
sudo chown fmserver /Library/FileMaker\ Server/HTTPServer/conf/extra/httpd-vhosts.conf
sudo /Library/Filemaker\ Server/HTTPServer/bin/httpdctl graceful
Objects on the layout are misaligned.
Glad you found it helpful.
V1 was using a plugin to write the file, but this version is native FileMaker and therefore also completely unlocked.
However, I was totally sure that the output was could be used "as-is" on the server....
Would you mind sending me your httpd.conf file, so I could look at it ?
Thanks for including Terminal commands to do the fix. If I can't find a way to output correctly from FileMaker, I would like to include these in the guide...
It may have something to do with FMS, FMPA, or Apache version.
Using FileMaker Pro Advanced 13v5 I exported the config file and it created file with CRs used as linebreaks.
Apache did not recognize them as line breaks, so I had to replace them with LFs.
I found another issue caused by Apache 2.4 described here: AH01630: client denied by server configuration
I had to add the "Require all granted" to the virtual host's directory options to make it work.
I hope this helps.
And yet one more issue (and solution): Apache: SSLEngine not allowed here
I also noticed that when I change the port from 443 to 80 then the SSL config is not removed but the popover button disappears, so I cannot remove it. It might be a good idea to have a script trigger on port number to handle this. ;-)
In my copy I have added a button named Apply saved Virtual hosts config that performs this AppleScript:
do shell script "sed -i `date '+.%Y%m%d%H%M%S'` 's:#Include conf/extra/httpd-vhosts.conf:Include conf/extra/httpd-vhosts.conf:' '/Library/FileMaker Server/HTTPServer/conf/httpd.conf'; rm /Library/FileMaker\\ Server/HTTPServer/conf/extra/httpd-vhosts.conf; tr '\\r' '\\n' < ~/Desktop/httpd-vhosts.conf > /Library/FileMaker\\ Server/HTTPServer/conf/extra/httpd-vhosts.conf; chown fmserver /Library/FileMaker\\ Server/HTTPServer/conf/extra/httpd-vhosts.conf; /Library/Filemaker\\ Server/HTTPServer/bin/httpdctl graceful" with administrator privileges
You may want to add it to the next version... ;-)
Thank you very much for your feedback. I will definately add your suggestions to a future revision, when I get time to get to this project again.