![]() |
simple script/control panel to register/add domains to a server?
is there anything that will actually register a domain, and add it to apache/bind/etc?
not something big like cpanel, should just be a simple script |
not familiar with one that does both of these
|
I think I have something like that ... will check.
|
check hotscripts.com, if there is one it will be listed there...
|
cpanel maybe?
|
I hacked this one out a million years ago but havnt needed it for at least three.......you will need to check to see if your apache settings and such are the same or change it if you need to.
Name it say newdomain.pl or something then run it from root using perl ./newdomain.pl .................................................. ................................................ #!/usr/bin/perl use DBI; %db = ( name => q'mysql', host => q'localhost', user => q'root', pass => q'what_ever_your_pass_is'); $VIRTUAL_CONF = "/etc/httpd/conf/httpd.conf"; $SERVER_IP = "64.146.115.0"; $VIRTUAL_ADMIN_EMAIL = "webmaster"; $MYSQL_ROOT_PASS = "whatever_it_is"; print "Enter a username: "; chomp($USERNAME = <STDIN>); print "Enter a hostname (without www): "; chomp($HOSTNAME = <STDIN>); print "Would u like to create a database for this user? (y or n): "; chomp($create_db = <STDIN>); if($create_db =~ m/^y.*/) { print "Please enter the database password: "; chomp($DBPASS = <STDIN>); } $HOMEDIR = "/home/$HOSTNAME"; print <<`EOS`; echo "Creating user in shell" /usr/sbin/useradd -d $HOMEDIR -g users -s /bin/bash $USERNAME echo "Creating account password" passwd $USERNAME echo "Creating user directories..." mkdir -p mode=0755 $HOMEDIR $HOMEDIR/public_html $HOMEDIR/stats $HOMEDIR/logs $HOMEDIR/cgi-bin $HOMEDIR/mailbox $HOMEDIR/bin chown -R $USERNAME:users $HOMEDIR cp /home/admin/.bash_profile $HOMEDIR echo "Adding user to apache config..." echo "<VirtualHost $SERVER_IP>" >> $VIRTUAL_CONF echo "ServerAdmin $SERVER_ACC_ADMIN_EMAIL\@$HOSTNAME" >> $VIRTUAL_CONF echo "DocumentRoot $HOMEDIR" >> $VIRTUAL_CONF echo "ServerName www.$HOSTNAME" >> $VIRTUAL_CONF echo "ServerAlias www.$HOSTNAME" >> $VIRTUAL_CONF echo "CustomLog $HOMEDIR/logs/apache-accesslog-$HOSTNAME.log combined" >> $VIRTUAL_CONF echo "ScriptAlias /cgi-bin/ \"$HOMEDIR/cgi-bin/\"" >> $VIRTUAL_CONF echo "Alias /stats/ \"/home/stats/$HOSTNAME/\"" >> $VIRTUAL_CONF echo "<Directory \"$HOMEDIR/cgi-bin/\">" >> $VIRTUAL_CONF echo "Options ExecCGI Includes IncludesNOEXEC" >> $VIRTUAL_CONF echo "AddHandler cgi-script .cgi .pl" >> $VIRTUAL_CONF echo "</Directory>" >> $VIRTUAL_CONF echo "</Virtualhost>" >> $VIRTUAL_CONF echo "" >> $VIRTUAL_CONF echo "Reloading apache and sendmail" /etc/init.d/httpd reload /etc/init.d/sendmail restart echo "Creating database..." EOS if($create_db =~ m/^y.*/) { dbconnect(); dbdo(qq|CREATE DATABASE $USERNAME|); dbdo(qq|INSERT INTO user VALUES ('localhost', '$USERNAME', 'PASSWORD', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'Y', 'N', 'N', 'Y', 'Y')|); dbdo(qq|INSERT INTO user VALUES ('matrixideas.com', '$USERNAME', 'PASSWORD', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'Y', 'N', 'N', 'Y', 'Y')|); dbdo(qq|INSERT INTO db VALUES ('', '$USERNAME', '$USERNAME', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'Y', 'Y')|); dbdo(qq|INSERT INTO host VALUES ('localhost', '$USERNAME', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'Y', 'Y')|); dbdo(qq|UPDATE user SET Password=PASSWORD('$DBPASS') WHERE user='$USERNAME'|); dbdo(qq|FLUSH PRIVILEGES|); $dbh->disconnect; } sub dbconnect { my $dsn = "DBI:mysql:$db{name}:$db{host}"; $dbh = DBI->connect( $dsn, $db{user}, $db{pass}, { RaiseError => 0 } ); return; } sub dbdo { $dbh->do(shift) || die "Unable to execute sql statement.\n"; return; } |
something like this:
http://www.vibralogix.com/cwhoiscart/ I used other of their scripts and was quite satisfied. You could modify it to integrate apache/bind integration... |
| All times are GMT -7. The time now is 12:02 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123