Create subdomains & mails using PHP ?

Does Interworx use a MySQL database ?

I don’t know linux but i know PHP a bit… Do you think i can create subdomains and emails using PHP and the iWorx DB ?

If no, can anyone help me for a shell script and how i can run it from PHP ?

What i want to do (example):
My website hosting is host.com
I have a secure service hosting: ssl.com

Each time a customer create an account with my web hosting service, i want my script to create:

Both domains are on the same server, and i want the two subdomains created to be redirected to userdomain.com (iworx account) so my customer can use both userdomain.com, user.host.com, or user.ssl.com (they all point to the same path on the server)
if he uses https://user.ssl.com it will be a secure server !

Firstly, i don’t know SSL, so is that possible ?
because i’ve read that, if i have a SSL certificate, my subdomains can use it as a certified secured site.

Secondly, how to create this ? my language is PHP and i use Iworx !
if someone can help me, just give me the commands, not the entire script (don’t do my work) :wink:

Thanks in advance for your help :slight_smile:
Roman.

You can create accounts from your site using just about any language that knows how to use XML - check out the API documentation here.

As for interacting directly with the Iworx-DB - I don’t believe this is possible. Iworx uses it’s own copy of PHP and MySQL from what runs the sites created in it. Therefore, I don’t think you’d be able to connect to the Iworx-DB directly.

I’m sure an Iworx person will clarify. As for using a shell script, I suppose it would be possible. It’d be just a matter of writing the appropriate commands, but there’s a lot more involved in setting up subdomains and SSL certificates. Subdomains require additions to the Apache conf files, updates to the DNS server, etc. SSL Certs require files to be moved around and installed and Apache’s conf files to be updated.

I think I got you here Roman: http://interworx.info/forums/showthread.php?t=329

Chris

Sonicgroup, for information, you may interact with the iworx-db.

For security reason I’ll not give you the full path but just do this

check in /home/interworx/etc/my.cnf the location of the mysql.sock
check in /home/interworx/iworx.ini the password for the user iworx

then in you php script

just do something like this

mysql_connect(‘localhost:2443:/the/path/to/the/iworx/mysql.sock’, ‘user’, ‘password’)

I use this to automaticly update some mail groups when I create a new siteworx account using the iworx API

Pascal