Ispconfig 3 Server Config screwup

Discussion in 'Installation/Configuration' started by drewb0y, Oct 5, 2010.

  1. drewb0y

    drewb0y Member

    I got my server set up with 3.0.3 beta with the perfect debian lenny setup using 5.0.6, got roundcube setup perfectly and the mailuser interface. I started adding some test domains for email. Even made one of them live actually. Got my Ispconfig interface setup to use https successfully. Everything was running smoothly until......

    I decided to do some early morning server maintenance and set up another domain to go live for email. All good so far, even figured out how to use fetchmail to pull users existing webmail over imap from the existing mailhost.

    Then I decided to poke around in the interface and see what settings are there.
    Bad idea before coffee.
    Went to the System > Server Config> "choose my server" > Server tab and noticed that the gateway and nameserver settings did not look right. So I changed them. Immediately breaking web access to everything.

    To make matters worse, I thought I would search for the files that were changed and change them back. Grep found a myd file with the new nameservers i had just entered. So I manually edited it. Bad idea number 2.

    Okay so I know now what I did, I think. I damaged the table in the dbispconfig database by manualy editing it. I managed to actually repair that database so I can at least open the table without it giving any errors. But there is no data in it.

    So if I were able to run some mysql commands to repopulate that table with the correct info, would that fix it?

    If so, can someone please send me what is in their table so I can duplicate it and attempt to get this going again, without starting over from scratch? Yo know like the commands you use to create the tables in an empty database.


    Many thanks....and I will remember to at least wake up a bit next time first
    : )
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you mean the "server" table in the ispconfig database? Here is the content from my lenny test server:

    Code:
    -- phpMyAdmin SQL Dump
    -- version 2.11.8.1deb5+lenny6
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Erstellungszeit: 05. Oktober 2010 um 22:19
    -- Server Version: 5.0.51
    -- PHP-Version: 5.2.6-1+lenny9
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    --
    -- Datenbank: `dbispconfig`
    --
    
    -- --------------------------------------------------------
    
    --
    -- Tabellenstruktur für Tabelle `server`
    --
    
    CREATE TABLE IF NOT EXISTS `server` (
      `server_id` int(11) unsigned NOT NULL auto_increment,
      `sys_userid` int(11) unsigned NOT NULL default '0',
      `sys_groupid` int(11) unsigned NOT NULL default '0',
      `sys_perm_user` varchar(5) NOT NULL default '',
      `sys_perm_group` varchar(5) NOT NULL default '',
      `sys_perm_other` varchar(5) NOT NULL default '',
      `server_name` varchar(255) NOT NULL default '',
      `mail_server` tinyint(1) NOT NULL default '0',
      `web_server` tinyint(1) NOT NULL default '0',
      `dns_server` tinyint(1) NOT NULL default '0',
      `file_server` tinyint(1) NOT NULL default '0',
      `db_server` tinyint(1) NOT NULL default '0',
      `vserver_server` tinyint(1) NOT NULL default '0',
      `config` text NOT NULL,
      `updated` bigint(20) unsigned NOT NULL default '0',
      `mirror_server_id` int(11) unsigned NOT NULL default '0',
      `dbversion` int(11) unsigned NOT NULL default '1',
      `active` tinyint(1) NOT NULL default '1',
      PRIMARY KEY  (`server_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
    
    --
    -- Daten für Tabelle `server`
    --
    
    INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `mirror_server_id`, `dbversion`, `active`) VALUES(1, 1, 1, 'riud', 'riud', 'r', 'ispconfig.int', 1, 1, 1, 1, 1, 1, '[global]\nwebserver=apache\nmailserver=postfix\ndnsserver=mydns\n\n[server]\nauto_network_configuration=y\nip_address=192.168.0.105\nnetmask=255.255.255.0\ngateway=192.168.0.1\nhostname=ispconfig.int\nnameservers=192.168.0.1,192.168.0.2\nloglevel=2\nbackup_dir=/var/backup\n\n[mail]\nmodule=postfix_mysql\nmaildir_path=/var/vmail/[domain]/[localpart]\nhomedir_path=/var/vmail\npop3_imap_daemon=dovecot\nmail_filter_syntax=sieve\nmailuser_uid=5000\nmailuser_gid=5000\nmailuser_name=vmail\nmailuser_group=vmail\nrelayhost=\nrelayhost_user=\nrelayhost_password=\nmailbox_size_limit=0\nmessage_size_limit=0\n\n[getmail]\ngetmail_config_dir=/etc/getmail\n\n[web]\nwebsite_basedir=/var/www\nwebsite_path=/var/www/clients/client[client_id]/web[website_id]\nwebsite_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/\nvhost_conf_dir=/etc/apache2/sites-available\nvhost_conf_enabled_dir=/etc/apache2/sites-enabled\nsecurity_level=20\nuser=www-data\ngroup=www-data\napps_vhost_port=8081\napps_vhost_ip=_default_\napps_vhost_servername=\nphp_open_basedir=[website_path]/web:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin\nhtaccess_allow_override=All\nawstats_conf_dir=/etc/awstats\nawstats_data_dir=/var/lib/awstats\nawstats_pl=/usr/lib/cgi-bin/awstats.pl\nawstats_buildstaticpages_pl=/usr/share/awstats/tools/awstats_buildstaticpages.pl\nphp_ini_path_apache=/etc/php5/apache2/php.ini\nphp_ini_path_cgi=/etc/php5/cgi/php.ini\ncheck_apache_config=y\n\n[dns]\nbind_user=root\nbind_group=bind\nbind_zonefiles_dir=/etc/bind\nnamed_conf_path=/etc/bind/named.conf\nnamed_conf_local_path=/etc/bind/named.conf.local\n\n[fastcgi]\nfastcgi_starter_path=/var/www/php-fcgi-scripts/[system_user]/\nfastcgi_starter_script=.php-fcgi-starter\nfastcgi_alias=/php/\nfastcgi_phpini_path=/etc/php5/cgi/\nfastcgi_children=8\nfastcgi_max_requests=5000\nfastcgi_bin=/usr/bin/php-cgi\n\n[jailkit]\njailkit_chroot_home=/home/[username]\njailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh\njailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico\njailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php\n\n[vlogger]\nconfig_dir=/etc\n\n[cron]\ninit_script=cron\ncrontab_dir=/etc/cron.d\nwget=/usr/bin/wget\n\n', 4, 0, 3, 1);
    
     
  3. drewb0y

    drewb0y Member

    Exactly. Hopefully this will work. So I guess apache gets some of its settings from this database? Because everything else works fine still except for that no ispconfig, webmail or phpmyadmin access.

    Thanks I will give that a try and see if it saves the day.
     
  4. drewb0y

    drewb0y Member

    Awesome! It worked. You just saved me the days it took to get everything just right. Now I just need to back up what I have just in case.

    For anyone else looking at this, all I had to do was ssh in

    Code:
    mysql -u root -p
    USE dbispconfig;
    Then

    Code:
    CREATE TABLE IF NOT EXISTS `server` (
      `server_id` int(11) unsigned NOT NULL auto_increment,
      `sys_userid` int(11) unsigned NOT NULL default '0',
      `sys_groupid` int(11) unsigned NOT NULL default '0',
      `sys_perm_user` varchar(5) NOT NULL default '',
      `sys_perm_group` varchar(5) NOT NULL default '',
      `sys_perm_other` varchar(5) NOT NULL default '',
      `server_name` varchar(255) NOT NULL default '',
      `mail_server` tinyint(1) NOT NULL default '0',
      `web_server` tinyint(1) NOT NULL default '0',
      `dns_server` tinyint(1) NOT NULL default '0',
      `file_server` tinyint(1) NOT NULL default '0',
      `db_server` tinyint(1) NOT NULL default '0',
      `vserver_server` tinyint(1) NOT NULL default '0',
      `config` text NOT NULL,
      `updated` bigint(20) unsigned NOT NULL default '0',
      `mirror_server_id` int(11) unsigned NOT NULL default '0',
      `dbversion` int(11) unsigned NOT NULL default '1',
      `active` tinyint(1) NOT NULL default '1',
      PRIMARY KEY  (`server_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
    and finally
    Code:
    INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `mirror_server_id`, `dbversion`, `active`) VALUES(1, 1, 1, 'riud', 'riud', 'r', 'ispconfig.int', 1, 1, 1, 1, 1, 1, '[global]\nwebserver=apache\nmailserver=postfix\ndnsserver=mydns\n\n[server]\nauto_network_configuration=y\nip_address=192.168.5.2\nnetmask=255.255.255.0\ngateway=192.168.0.1\nhostname=ispconfig.int\nnameservers=192.168.0.1,192.168.0.2\nloglevel=2\nbackup_dir=/var/backup\n\n[mail]\nmodule=postfix_mysql\nmaildir_path=/var/vmail/[domain]/[localpart]\nhomedir_path=/var/vmail\npop3_imap_daemon=dovecot\nmail_filter_syntax=sieve\nmailuser_uid=5000\nmailuser_gid=5000\nmailuser_name=vmail\nmailuser_group=vmail\nrelayhost=\nrelayhost_user=\nrelayhost_password=\nmailbox_size_limit=0\nmessage_size_limit=0\n\n[getmail]\ngetmail_config_dir=/etc/getmail\n\n[web]\nwebsite_basedir=/var/www\nwebsite_path=/var/www/clients/client[client_id]/web[website_id]\nwebsite_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/\nvhost_conf_dir=/etc/apache2/sites-available\nvhost_conf_enabled_dir=/etc/apache2/sites-enabled\nsecurity_level=20\nuser=www-data\ngroup=www-data\napps_vhost_port=8081\napps_vhost_ip=_default_\napps_vhost_servername=\nphp_open_basedir=[website_path]/web:[website_path]/tmp:/var/www/[website_domain]/web:/srv/www/[website_domain]/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin\nhtaccess_allow_override=All\nawstats_conf_dir=/etc/awstats\nawstats_data_dir=/var/lib/awstats\nawstats_pl=/usr/lib/cgi-bin/awstats.pl\nawstats_buildstaticpages_pl=/usr/share/awstats/tools/awstats_buildstaticpages.pl\nphp_ini_path_apache=/etc/php5/apache2/php.ini\nphp_ini_path_cgi=/etc/php5/cgi/php.ini\ncheck_apache_config=y\n\n[dns]\nbind_user=root\nbind_group=bind\nbind_zonefiles_dir=/etc/bind\nnamed_conf_path=/etc/bind/named.conf\nnamed_conf_local_path=/etc/bind/named.conf.local\n\n[fastcgi]\nfastcgi_starter_path=/var/www/php-fcgi-scripts/[system_user]/\nfastcgi_starter_script=.php-fcgi-starter\nfastcgi_alias=/php/\nfastcgi_phpini_path=/etc/php5/cgi/\nfastcgi_children=8\nfastcgi_max_requests=5000\nfastcgi_bin=/usr/bin/php-cgi\n\n[jailkit]\njailkit_chroot_home=/home/[username]\njailkit_chroot_app_sections=basicshell editors extendedshell netutils ssh sftp scp groups jk_lsh\njailkit_chroot_app_programs=/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico\njailkit_chroot_cron_programs=/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php\n\n[vlogger]\nconfig_dir=/etc\n\n[cron]\ninit_script=cron\ncrontab_dir=/etc/cron.d\nwget=/usr/bin/wget\n\n', 4, 0, 3, 1);
    Restart apache
    Code:
    /etc/init.d/apache2 restart
    And everything is back as it was.

    In the insert section, be sure to change 192.168.5.2 to reflect your servers IP address and all else is the same.

    Thanks again Till
     

Share This Page