Step-by-Step Guide to Installing and Using Clip Server and SDK on Linux
This article provides a comprehensive tutorial on installing the Clip Server (Apache, PHP, MySQL), configuring its virtual host, setting up the Clip SDK with Python, and using various Clip commands to manage IP relationships, all illustrated with command examples and screenshots.
Clip Server Installation
Install Apache, PHP, and MySQL:
<code>yum install httpd php mysql mysql-server</code>Install the Clip Web interface (Doitphp framework):
Create the HTTP virtual host directory:
<code>mkdir -p /data/webroot/</code>Download the package:
<code>wget http://blog.puppeter.com/download/clip/clip_web.tar.gz</code>Extract the package:
<code>tar -xvzf clip_web.tar.gz -C /data/webroot/</code>Append virtual‑host configuration to
httpd.conf:
<code>NameVirtualHost *:80
ServerAdmin [email protected]
DocumentRoot /data/webroot/clip_server/
ServerName clip.puppeter.com
ErrorLog logs/clip.puppeter.com-error_log
CustomLog logs/clip.puppeter.com-access_log common</code>Start Apache:
<code>service httpd start</code>Initialize the Clip Web MySQL database:
Start MySQL:
<code>service mysqld start</code>Download the table structure:
<code>wget http://blog.puppeter.com/download/clip/clip_db.tar.gz</code>Import the tables:
<code>mysql -u root -p
create database clip;
exit;
mysql -u root -p clip < clip.sql;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
FLUSH PRIVILEGES;</code>Configure Clip Web to connect MySQL by editing /data/webroot/clip_server/application/config/clip.ini.php .
Clip SDK Installation
The Clip SDK is Python‑based; the following steps install its dependencies.
Install Python and expect (supports Python 2.6 and 2.7):
<code>yum install python expect</code>Download the Clip SDK:
<code>wget http://blog.puppeter.com/download/clip/clip_latest.tar.gz</code>Extract and install the SDK (install to /usr/local/services ):
<code>tar -xvzf clip_p1.0.tar.gz -C /usr/local/services</code>Edit clip/conf/clip.ini and set server_ip to the Clip web IP.
Add Clip to the system PATH:
<code>export PATH=$PATH:/usr/local/services/clip/</code>or permanently: <code>echo 'export PATH=$PATH:/usr/local/services/clip/' >> /etc/profile && source /etc/profile</code>
Clip SDK Usage
The Clip SDK manages IP‑String relationships on the server and can store them locally.
clip scan – Scan ports of IPs associated with a String:
<code>--query_string (-q) # Scan ports for a String
--ip (-i) # Scan a specific IP
--append (-a) # Append IPs to an existing String
--remove_ip (-r) # Remove IPs from a String
--limit (-l) # Limit IP range
--port (-P) # Custom port (default 80)
--log_disable (-o) # Disable log reporting</code>Example:
Scan *-puppet-*-* for open ports.
clip cstring – Resolve String ↔ IP relationships:
<code>--query_string (-q) # Get IP list for a String
--ip (-i) # Get String for an IP
--limit (-l) # Limit range
--append (-a) # Append IPs
--remove_ip (-r) # Remove IPs
--join (-j) # Output format ("|", ",", "\n", space)
--count (-c) # Count IPs
--dryrun (-d) # Show API call</code>Resolve *-qq-*-* to its IPs.
Resolve IP 192.168.0.7 to its String.
clip ssh – Remote command execution:
<code>--password (-p) # Password
--append (-a) # Append IPs
--remove_ip (-r) # Remove IPs
--limit (-l) # Limit range
--port (-P) # Custom port (default 22)
--dryrun (-d) # Show API call
--log_disable (-o) # Disable log reporting</code>Check load on machines matching sh-docker-base_v1-* .
clip scp – Remote file copy:
<code>--password (-p) # Password
--append (-a) # Append IPs
--remove_ip (-r) # Remove IPs
--limit (-l) # Limit range
--port (-P) # Custom port (default 22)
--dryrun (-d) # Show API call
--log_disable (-o) # Disable log reporting</code>Push an IP file to /tmp on machines matching sh-docker-base_v1-* .
tree – Traverse String relationships:
<code>--query_string (-p) # Query String
--json (-j) # Output format
--dryrun (-d) # Show API call
--log_disable (-o) # Disable log reporting</code>Traverse nodes under *-*-*-* .
import – Import IP relationships into the database:
<code>--insert (-i) # Import from file
--bulid (-b) # Create import template
--list_struct (-l) # Show DB structure</code>Run clip import -b to create a template.
lt – Local tool for managing IP relationships via SSH:
<code>--password (-p) # Password
--append (-a) # Append IPs
--remove (-r) # Remove IPs
--port (-P) # Custom port (default 22)</code>Execute remote SSH commands based on a local IP file.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.