Hi, I have my apache server setup to do virtual hosting. I need to be able to host multiple websites on my server. I currently hosting just 2. However, do plan to expand to 40 websites. I am going to start to provide web hosting services. My websites are coded in PHP. I plan to use PHP and javascript to build a website builder right on my website.
However, I am just starting to code the whole thing. I have the check out process done where you place an order for the domain name. The problem is that after all that I need to create a folder in the folder called websites. The folder will be the name of the domain name. However, since the client can buy more then 1 domain name at a time. I will need to loop through making folders for each domain name bought. Each folder will have the proper permissions set. I don't have an issue doing this. I know how to do this in php.
The problem comes when dealing with apache. I don't know exactly what I need to do to setup apache to recognize the new website. I know there is a website-enabled type folder. I know in there I have my 2 websites config files located there. I have no problem creating the file with the proper config for the website itself. However, I recall from setting up those 2 websites that I already setup that some type of commands is needed to be run on apache on FreeBSD in order for the apache to be setup properly to start hosting that new website.
So, I need to know what is needed for apache to recognized this new website? Do I just need to create a file with the website config/settings and just save that file in the folder called websites-enabled inside the apache 2 folder? Or do I need to do more then just create that file? If so then what else is there needed to create another virtual hosted domain name / website?
However, I am just starting to code the whole thing. I have the check out process done where you place an order for the domain name. The problem is that after all that I need to create a folder in the folder called websites. The folder will be the name of the domain name. However, since the client can buy more then 1 domain name at a time. I will need to loop through making folders for each domain name bought. Each folder will have the proper permissions set. I don't have an issue doing this. I know how to do this in php.
The problem comes when dealing with apache. I don't know exactly what I need to do to setup apache to recognize the new website. I know there is a website-enabled type folder. I know in there I have my 2 websites config files located there. I have no problem creating the file with the proper config for the website itself. However, I recall from setting up those 2 websites that I already setup that some type of commands is needed to be run on apache on FreeBSD in order for the apache to be setup properly to start hosting that new website.
So, I need to know what is needed for apache to recognized this new website? Do I just need to create a file with the website config/settings and just save that file in the folder called websites-enabled inside the apache 2 folder? Or do I need to do more then just create that file? If so then what else is there needed to create another virtual hosted domain name / website?