Jump to content

Recommended Posts

I am no Apache expert, but I have been making virtual hosts for every subdomain I make, is there a way for me to only make on virtual host and it will do what ever it is that it does?

 

 

so, instead of doing this for each subdomian I want, how could I make it dynamic so I only have to create one (is this even possible)?

<VirtualHost *:80>
ServerAdmin admin@weblyize.com
ServerName  stats.weblyize.com
ServerAlias www.stats.weblyize.com
DocumentRoot C:/wamp/www/stats.weblyize.com
ErrorLog  C:/wamp/bin/apache/Apache2.2.21/logs/stats.weblyize.com/error.log
CustomLog C:/wamp/bin/apache/Apache2.2.21/logs/stats.weblyize.com/access.log combined
</VirtualHost>

Link to comment
https://forums.phpfreaks.com/topic/258126-dynamic-subdomians/
Share on other sites

Not if they all have different document roots and log files and such.

 

Not that I've done this myself, but I believe the method to do multiple websites is to create a configuration file from each (based on a template) and have Apache reload its settings. It'd be one of the steps in the "create a subdomain" step, alongside making directories and updating databases and whatnot.

Link to comment
https://forums.phpfreaks.com/topic/258126-dynamic-subdomians/#findComment-1323181
Share on other sites

doesn't Apache have something similar to variables?

 

just found this no idea if its good or not:

http://www.cri.ensmp.fr/~coelho/mod_macro/

 

What about something like this:

<VirtualHost *:80>
ServerAdmin admin@weblyize.com
ServerName  %{HTTP_HOST}
ServerAlias www.%{HTTP_HOST}
DocumentRoot C:/wamp/www/%{HTTP_HOST}
ErrorLog  C:/wamp/bin/apache/Apache2.2.21/logs/%{HTTP_HOST}/error.log
CustomLog C:/wamp/bin/apache/Apache2.2.21/logs/%{HTTP_HOST}/access.log combined
</VirtualHost>

Link to comment
https://forums.phpfreaks.com/topic/258126-dynamic-subdomians/#findComment-1323190
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.