Results 1 to 3 of 3
  1. #1
    Join Date
    May 2001
    Prince Edward Island

    Php & Virtual Hosts

    I have been looking ( off and on ) for a PHP - Or perl script that will allow me to edit My httpd.conf -- specifically the Virtual hosts section using forms?

    Add or remove.

    is anyone aware of something like this??

    I know webmin can allow for this, but I am looking for a straight script.
    [url]I got nothing/url]

    For clarity's sake, don't use "<ip address of hostname>" use the ACTUAL 32-bit numeric IP address of the machine.

  2. #2
    Join Date
    Jun 2002
    Arcadia, CA
    Actually writing a script for that should honestly be pretty easy. I would suggest a line at the bottom of your httpd.conf file including another file and then having that have all your virtual hosts as well - just to be on the safe side.

    Sorry I can't help you with one already made though. Good luck! - Custom web development - Instant backups with rsync, FTP, VPN, etc.

  3. #3
    Join Date
    Jul 2005
    Ann Arbor, MI
    I've heard of a few people setting up their apache configs to be database driven. I like ccole's idea of including your 'custom' file at the end of the main httpd.conf.

    Say you keep all your hosting attributes in a mysql database that distinguish each domain. Perhaps all you need to store is the domain name and its document root. Then you could write a quick script that generates all the VirtualHost blocks and writes them to that file. Anytime you add/remove a site, just re-run that script to regenerate the file.

    Of course, this cuts down your ability to add customized directives to each host. But if every host just needs the same config, this would work well. It'd also be great for when you want to add a new directive to EVERY host. You wouldn't have to go in and add it manually to each one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts