I want to add a web site to a Centos VPS programmatically, I found many references to IIS, but nothing for Linux.
I have a site that lets the users create a customized web site. What I want is give the users the option to use their own domain.
So, when the user add his/her own domain (and point his/her domain to my DNS server) add this domain as an add-on domain to my server and also add a virtual host to apache....
any help will be appreciated...
Regards Alex
Something like cPanel or ISPconfig ?
You can install virtualmin and use their API via REST URL or run script remotely. It does mailboxes too.
Yes, this is simple. I've previously run a webfarm (using 1.3.27) with around 1000 vhosts configured on each server exactly like this - startup took a couple of seconds longer but otherwise there was little difference from a single vhost. Just specify a directory to contain the definitions for the vhosts (one per file) and set up a directory tree for each website. The machine I'm typing this at came with Apache 2.2 pre-configured to handle just such a case; in the httpd.conf there's a line:
And the create a file, say example.com.conf containing:
You might want to create a user at the same time and point their home directory to the base locattion (/var/vhosts/example.com). I'd recommend disabling all cgi / shtml / php /symlinks etc unless you know how to configure these securely. Preferably allow override none too.
An alternative approach is to use a wildcard vhost with all requests routed to your front controller which would then invoke specific bits of functionality - but this requires rather a lot of development effort.