PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 12th, 2004, 02:26 PM
blahpro blahpro is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 2 blahpro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow Editing Apache VirtualHost containers with PHP...

Hi,

As a project for the school holidays, I am trying to write a PHP script that can add, remove and edit entire <VirtualHost> and <Directory> containters (as well as the directives contained inside them) from Apache's httpd.conf. This will mostly be running on a Windows test server.

Adding the lines to the conf file is easy - just check to see if it already exists and if not, append the text to the end of the file.

To edit/remove containers and directives, I thought I could try and match up lines using regular expressions (i.e delete a specified <Directory /dir-name-here> "tag" and then delete every line after that until I reach the closing "tag" - i.e. </Directory>). The problem is, I am quite inexperienced with PHP, and was wondering if anyone could get me going with some ideas on how to turn that idea into code?

Also comes the problem with grabbing information from the conf file and displaying it as a list on an HTML page (i.e. list all the VirtualHosts that exist).

If anyone can help, it is VERY much appreciated!

Thanks,


Ben Hodgson

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Editing Apache VirtualHost containers with PHP...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway