PDA

View Full Version : Automated site creation


mentaldirector
04-26-2010, 08:37 PM
Hi,

I want to create a shell script, which will create www domain, database and user, and copy some standard scripts below www directory.

Do you have such a sample?

I wasn't able to find domain / db creation in the API.

Thank you for this great software... :rolleyes:

mentaldirector
04-26-2010, 11:21 PM
Ok, I've found the answer :)

/usr/local/ispmgr/sbin/mgrctl wwwdomain.edit domain=test.com alias=www.test.com

owner=username php=phpmod sok=yes ip=x.x.x.x admin=test@test.com

charset=utf8 cgi=on autosubdomain=asdnone

;)

mentaldirector
04-27-2010, 01:09 AM
Now I need to run it in a PHP script.

I'm trying exe command with php but there is no response. Do you have an idea?

slava
04-27-2010, 11:24 PM
Try run as
/usr/bin/php-cgi -q script.php
or add to firstl line of script
#!/usr/bin/php-cgi -qand run as
./script.php

mentaldirector
04-27-2010, 11:56 PM
Thank you but I'm not trying to run phpscript in the shell.

I'm trying to run shell script in php script (with exec/system/passthru etc). I think there is a permission problem. For example I can run whoami and see which user executes php scripts. Then I've added that user to operator group to enable letting it run shell scripts. But it didn't work.

By the way, my VPS is in JoinVPS and it's prebundled with FreeBSD 8.0 + ISP Manager. Actually it's working perfect, really. Better than any control panel app. Congratulations in deed.