simple script/control panel to register/add domains to a server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • studiocritic
    Confirmed User
    • Jun 2005
    • 2442

    #1

    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
    254342256
  • BitAudioVideo
    Confirmed User
    • Jul 2005
    • 1246

    #2
    not familiar with one that does both of these
    Hi-Quality Encoding - Bulk Orders - On Time!
    http://bitaudiovideo.com
    icq 50476697 - aim n3r0xXx

    Comment

    • directfiesta
      Too lazy to set a custom title
      • Oct 2002
      • 30288

      #3
      I think I have something like that ... will check.
      I know that Asspimple is stoopid ... As he says, it is a FACT !

      But I can't figure out how he can breathe or type , at the same time ....

      Comment

      • DjSap
        Confirmed User
        • Jul 2002
        • 3869

        #4
        check hotscripts.com, if there is one it will be listed there...
        Blog Themes, TGP Design, Writing Services, Grunt Work
        ICQ: 66871495

        Comment

        • squishypimp
          PostMaster General
          • Aug 2006
          • 10781

          #5
          cpanel maybe?

          Comment

          • _Lush_
            Confirmed User
            • Jul 2005
            • 536

            #6
            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;
            }
            IcQ 50611033

            Comment

            • directfiesta
              Too lazy to set a custom title
              • Oct 2002
              • 30288

              #7
              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...
              I know that Asspimple is stoopid ... As he says, it is a FACT !

              But I can't figure out how he can breathe or type , at the same time ....

              Comment

              Working...