Add New Hosting to a System Installed With Plugged.sh

If you use our LAMP installer script and want to add a new domain afterwards, we’ve created a simple script to ease up the process. This script creates a new user, adds the domain settings for Apache, adds a new MySQL Database and user, restarts necessary services.

Simply get our script from here or on your server via wget.
wget http://plugged.in/downloads/hostingadd.sh
Run the script (as root) to learn about the usage.
sh hostingadd.sh
    
Usage: hostingadd.sh -u username -p password -d domain -ip IP -dbu dbuser -dbn dbname -dbp dbpass
    
-u username : Set the LOGIN name (FTP user)
-p password : Set the Password
-d domain : Set the Domain
-ip ip : Set the IP address for the domain
-dbu dbuser : Set the MySQL User
-dbn dbname : Set the MySQL Database Name
-dbp dbpass : Set the MySQL User Password
The parameters are explained above. The script will try to create the MySQL databases as root, so it will need access to MySQL. In order to manage it, you’ll have to create a .my.cnf file under your /root  path. The /root/.my.cnf file should be like this :
[client]
user=root
pass=yourMySQLrootPassword
Don’t worry about writing your password in clear text. This file is restricted by root access anyway, so if someone can read this file, your server is already compromised.

You can access via FTP by using the username and password provided while running the script. You can also check if the database is successfully added via phpmyadmin (which is installed by plugged.sh)

There isn’t an uninstall script yet, but I’ll write one asap.
  • 7 Users Found This Useful
Was this answer helpful?

Related Articles

Setting time with NTP in LINUX

NTP (Network Time Protocol) could be used to set time synced with ntp clocks, to do this use the...

Linux version & Operating System info

LINUX Version Info To learn the architecture and kernel version info use the shell command...

Ephemeral port range for FTP

The standart linux distrubition calls that the ephemeral port range be between 1024 and 4999. We...

Compile and build Apache + MySQL + PHP from the source [cite]

This is a complete working solution to build Apache (httpd-2.2.25), MySQL (MySQL-5.6.14) and PHP...

Using vi Editor

Vi is the one of the mostly used editor in Linux via terminal. In most cases where Linux is used...