Create Apache Alias Using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

Create Apache Alias Using PHP

Post by mad_phpq »

Can anyone tell me if its possible to write php code to add/edit an apache alias.
User avatar
Sekka
Forum Commoner
Posts: 91
Joined: Mon Feb 18, 2008 10:25 am
Location: Huddersfield, West Yorkshire, UK

Re: Create Apache Alias Using PHP

Post by Sekka »

As long as the PHP file has the right permissions and access rights to edit the httpd.conf, I don't see why not.

Please note this is purely guess work on my part.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Create Apache Alias Using PHP

Post by RobertGonzalez »

Do you really want PHP doing this?
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

Re: Create Apache Alias Using PHP

Post by mad_phpq »

Wow! Forgot i asked this and recently its cropped up again.....

yes, i think i will have to edit the httpd.conf directly. We have a site generator that adds applications outside a web root. We need to be able to create aliases...... just had a terrible feeling while typing this, thinking that we need to restart apache everytime i want to add an alias. There has to be another way.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Create Apache Alias Using PHP

Post by RobertGonzalez »

(Almost) Any time you mess with a conf file you will have to restart the daemon. Such is the case with Apache, MySQL and PHP.
Post Reply