User Tools

Site Tools


start:howto:use_command_line_tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start:howto:use_command_line_tools [2013/09/15 20:50]
aseques replaced the domain*.php with the domain_imscp_*php
— (current)
Line 1: Line 1:
-====== Managing i-mscp from CLI ====== 
  
-This is a set of tools created to simplify the daily tasks of the administrators. 
-At the moment it's not part of i-mscp and probably won't be, because the codestyle is not the best and many parts of the code should be rewritten. 
- 
-__But, it does the job :)__ 
- 
- 
-===== The domain_imscp.php script ===== 
- 
-Basically the idea behind it is so you can use it altogether with rsync to migrate from other control panels (such as plesk) in a fully automated way. 
-Also it will help to manage the daily stuff and administrator have to do, create new users, change passwords, and so on.. 
-The objective is to code the minimum possible and use all the i-mscp methods, so most of the stuff done in the scripts is to insert the proper entrie into the database, trying always to be conservative about deleting stuff. 
- 
-This Command line a is a work in progress, and is being adapted from a previous version. 
-But still, it should help the people in their daily tasks. ​ 
- 
-At the moment it cannot '​yet'​ be used on a production environment for all the actions i-mspcp requires, but some parts are already working. 
- 
-===== Where to get it ===== 
-At the moment, and until the code is fully functional the version has to be picked up from and external repository at: 
-[[https://​bitbucket.org/​aseques/​cli-tools-ispcp|bitbucket.org]] 
- 
- 
-If you have questions/​issues,​ the best place to find help is at [[http://​forum.i-mscp.net/​Thread-Command-line-tools-for-i-mscp?​pid=5969|the forum]] 
- 
-===== How to use it ===== 
-Once you dowload it, after extracting the files, the first thing you have to do is to copy the config.php.dist to config.php and change the variables to fit your environment (all of them should be self explanatory,​ you can ask on the forum otherwise). 
- 
-There are two different scripts you can use to manage your server: 
- 
-**domain_imscp.php**:​ This script allows you to create all the stuff you need to be able to migrate a domain, such as the mailboxes, the mail aliases, the ftp accounts, and much more, also it allow you to delete domains and domains_alias. 
- 
-**domain_imscp_dns.php**:​ This script helps you to administrate the dns for your domains. With it you can create any kind of dns type allowed by the control panel. 
- 
-You can do the following: 
- 
-Create a new domain and the administrator for it 
-  php domain_imscp.php --action create_domain --created_by '​admin'​ --domain '​example.com'​ --password '​adminpass'​ --hosting_plan '​FullPlan'"​ 
- 
-Change the ownership of the htdocs direcory to be the right one (also for the htsdocs) 
-  php domain_imscp.php --action fix_htdocs_owner --domain '​example.com'"​ 
- 
-Also, not less important: ​ 
-  * create_ftp 
-  * create_mail 
-  * create_mail_alias 
-  * create_dom_alias 
-  * create_db 
-  * create_db_user 
-  * create_subdomain 
-  * regenerate_domain 
-  * create_default_mail 
-  * disable_mail 
-  * enable_mail 
-  * create_htaccess_user #Creates a htaccess user to be used to protect a folder or view stats 
-  * join_htaccess_group #Joins the htaccess user to the stats group to see statistics 
-  * set_mail_limit 
- 
-With the domain_imscp_dns.php you can do the following: 
-  * create_dns 
- 
-The current release has the ability to delete domains too. 
-This is DANGEROUS, I am running it without problems in a system with 1.0.5, but double check before using it, because the changes are permanent, and there'​s no way to recover the deleted domains. 
-In case you want to try it, launch the domain_imscp.php with the option: ​ 
-  * delete_domain 
-  * delete_alias 
- 
-===== Example ===== 
- 
-  #Domain creation 
-  php domain_imscp.php --action create_domain --created_by '​reseller'​ --domain '​example.com'​ --password '​adminpass'​ --hosting_plan '​FullPlan'"​ 
-  #Ftp creation 
-  php domain_imscp.php --action '​create_ftp'​ --created_by '​reseller'​ --domain '​example.com'​ --user '​admin'​ --password '​adminpass';​ 
-  #Creating the default mailboxes (postmaster,​ webmaster and abuse) 
-  php domain_imscp.php --action '​create_default_mail'​ --domain '​example.com';​ 
-  #In case you want to customize the dns entries for some customers, you should edit the db_e.tpl 
-  # file removing what you want to customize and create the entries for EVERY domain. 
-  #You only have to create the www entry in case you allow your customers to customize them. 
-  php domain_imscp_dns.php --action '​create_dns'​ --domain '​example.com'​ --dns_type '​CNAME'​ --dns_sub '​www'​ --dns_txt '​example.com.';​ 
-  ​ 
-  #You only have to create the mx entries if you let your customers to customize them 
-  # in that case you should alter the dns templates) 
-  php domain_imscp_dns.php --action '​create_dns'​ --domain '​example.com'​ --dns_type '​MX'​ --dns_sub '​example.com.'​ --dns_txt '​mx1.example.com.'​ --dns_prio '​10';​ 
-  php domain_imscp_dns.php --action '​create_dns'​ --domain '​example.com'​ --dns_type '​MX'​ --dns_sub '​example.com.'​ --dns_txt '​mx2.example.com.'​ --dns_prio '​20';​ 
-  ​ 
-TODO, add detail to add the htusers/​htgroup for awstats 
- 
- 
-===== Test scripts ===== 
-In the tar file, you will also find a bash script called verify_cli.sh,​ that will print the commands to create a complete domain and delete it, if that part is working, then everything should work. 
/var/www/virtual/i-mscp.net/wiki/htdocs/data/attic/start/howto/use_command_line_tools.1379278251.txt.gz · Last modified: 2013/09/15 20:50 by aseques