Welcome Guest, Not a member yet? Register   Sign In
Automatic/Push Button site folder/vhost creation in Linux via CI/PHP
#5

[eluser]n0xie[/eluser]
[quote author="Devon Lambert" date="1274390710"][quote author="n0xie" date="1274364339"]You can just write a bash script, then call that from within PHP. This is my addsite.sh I call when starting a new project which takes care of vhost and hosts file[/quote]

Hey Noxie,

Does this code actually make an addition to the existing vhost/host files OR does it create a new vhost/host file for each site?
[/quote]
It creates a new vhost for every file.

Quote:i.e. How do you tell the script that your adding www.mygreatnewsite.com to the file
It accepts a parameter, which is the name of the site. In my case ./addsite www.mygreatnewsite.com, creates www.mygreatnewsite.com. It copies my template vhost file then replaces all instances of the word 'site' with the actual site name.

Quote:how does it know that this new site is supposed to reference the same ip address as every other site already on file?
I don't really understand the question: you tell your vhosts what url belongs to it and apache takes care of the rest. The ip part is usually done using dns.


Messages In This Thread
Automatic/Push Button site folder/vhost creation in Linux via CI/PHP - by El Forum - 05-21-2010, 08:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB