Forum Moderators: coopster

Message Too Old, No Replies

Rewriting the Apache virtualhosts file from a php script

         

ucentric

12:46 pm on Sep 20, 2010 (gmt 0)

10+ Year Member



Can anyone help?

I am trying to get a php script to rewrite the Apache httpd-vhosts.conf file but cannot get the script to write carriage returns properly to the file and end up with it all running concurrently.

Any advice?

coopster

10:49 am on Oct 5, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, ucentric.

You could modify a single file or write new .conf files and use the Apache Include with a wildcard to read multiple virtual host configurations from a directory.

The carriage returns could be as simple as "\n" on a *nix server. Should work on WIN servers too.