PDA

View Full Version : Second Hard Drive


dayjahone
30th June 2007, 20:43
I installed ISPConfig, everything was working well. I added a second hard drive that is much larger than the other. So far, so good. I copied all of the files in /var to the new larger hard drive, mounted the new hard drive as /var and get the following error when I try to log in to ISPConfig:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) in /home/admispconfig/ispconfig/lib/classes/ispconfig_db_mysql.lib.php on line 77

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) in /home/admispconfig/ispconfig/lib/classes/ispconfig_db_mysql.lib.php on line 77

Warning: Cannot modify header information - headers already sent by (output started at /home/admispconfig/ispconfig/lib/classes/ispconfig_db_mysql.lib.php:77) in /home/admispconfig/ispconfig/web/login/login.php on line 60

I ran umount /var for now. Can anyone tell me where I went wrong? Thanks.

till
30th June 2007, 23:03
Please restart mysql, do you get any errors? Have you preserved all permissions as you copied the files?

dayjahone
1st July 2007, 08:28
I restarted with /var unmounted and now I can't access the ISPConfig login. I deleted the second hard drive from fstab and restarted. It didn't give any errors, but I still couldn't access ISPConfig. I added the hard drive to fstab again, restarted mysql and got the following:

root@mail:~# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro,usrquota,grpquota)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.20-15-generic/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sdb1 on /var type ext3 (rw,errors=remount-ro)
root@mail:~# /etc/init.d/mysql restart
* Stopping MySQL database server mysqld
...done.
* Starting MySQL database server mysqld
...fail!
root@mail:~#

One thing I did differently from the instructions on this thread http://www.howtoforge.com/forums/showthread.php?t=13547&highlight=hard+drive . . . I did not stop ISPConfig before copying. I copied it using the following command: cp -Rp /var/* /tempVar

root@mail:/# /etc/init.d/ispconfig_server restart
Shutting down ISPConfig system...
/root/ispconfig/httpd/bin/apachectl stop: httpd (no pid file) not running
ISPConfig system stopped!
Starting ISPConfig system...
/root/ispconfig/httpd/bin/apachectl startssl: httpd could not be started
Could not connect to MySQL server!ISPConfig system is now up and running!
root@mail:/#

till
1st July 2007, 12:11
This has all nothing to do with ISPConfig. Your problem is that mysql is not working and as long as mysql is not working, you can not start ISPConfig.

Have a look at your mysql and syslog and fix the mysql problem to be able to use ISPConfig again.

dayjahone
1st July 2007, 19:12
How can I diagnose the problem with mysql?

Here is what I found in /var/log/syslog:

Jul 1 07:46:36 mail postfix/pickup[13549]: warning: connect #1 to subsystem public/cleanup: Connection refused
Jul 1 07:46:46 mail postfix/pickup[13549]: warning: connect #2 to subsystem public/cleanup: Connection refused
Jul 1 07:46:56 mail postfix/pickup[13549]: warning: connect #3 to subsystem public/cleanup: Connection refused
Jul 1 07:47:06 mail postfix/pickup[13549]: warning: connect #4 to subsystem public/cleanup: Connection refused
Jul 1 07:47:16 mail postfix/pickup[13549]: warning: connect #5 to subsystem public/cleanup: Connection refused
Jul 1 07:47:26 mail postfix/pickup[13549]: warning: connect #6 to subsystem public/cleanup: Connection refused
Jul 1 07:47:36 mail postfix/pickup[13549]: warning: connect #7 to subsystem public/cleanup: Connection refused
Jul 1 07:47:46 mail postfix/pickup[13549]: warning: connect #8 to subsystem public/cleanup: Connection refused
Jul 1 07:47:56 mail postfix/pickup[13549]: warning: connect #9 to subsystem public/cleanup: Connection refused
Jul 1 07:48:06 mail postfix/pickup[13549]: warning: connect #10 to subsystem public/cleanup: Connection refused
Jul 1 07:48:16 mail postfix/pickup[13549]: fatal: connect #11 to subsystem public/cleanup: Connection refused


root@mail:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:2208 *:* LISTEN 4667/hpiod
tcp 0 0 *:mysql *:* LISTEN 5810/mysqld
tcp 0 0 *:www *:* LISTEN 5445/apache2
tcp 0 0 *:ftp *:* LISTEN 5630/proftpd: (acce
tcp 0 0 mail.mydomain.co:domain *:* LISTEN 5595/named
tcp 0 0 localhost:domain *:* LISTEN 5595/named
tcp 0 0 localhost:ipp *:* LISTEN 4637/cupsd
tcp 0 0 localhost:953 *:* LISTEN 5595/named
tcp 0 0 *:smtp *:* LISTEN 5547/master
tcp 0 0 *:https *:* LISTEN 5445/apache2
tcp 0 0 localhost:2207 *:* LISTEN 4672/python
tcp 17 0 localhost:smtp localhost:3113 CLOSE_WAIT -
tcp6 0 0 *:imaps *:* LISTEN 4909/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 4951/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 4926/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 4882/couriertcpd
tcp6 0 0 *:domain *:* LISTEN 5595/named
tcp6 0 0 *:ssh *:* LISTEN 5105/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 5595/named
tcp6 0 0 *:smtp *:* LISTEN 5547/master
tcp6 0 2112 server1.mydomain.com:ssh c-67-186-198-183.:65199 ESTABLISHED16494/0


root@mail:~# ls -l /home/admispconfig/ispconfig/lib/
total 68
-rwxr-xr-x 1 admispconfig admispconfig 5967 2007-06-30 10:30 app.inc.php
-rwxr-xr-x 1 admispconfig admispconfig 1768 2007-06-30 10:30 banner.inc.php
drwxr-xr-x 2 admispconfig admispconfig 4096 2007-06-30 10:34 classes
-rw------- 1 admispconfig admispconfig 7029 2007-06-30 10:30 config.inc.php
-rwxr-xr-x 1 admispconfig admispconfig 354 2007-06-30 10:30 copyright.inc.php
-rwxr-xr-x 1 admispconfig admispconfig 7480 2007-06-30 10:30 go_info.inc.php
drwxr-xr-x 2 admispconfig admispconfig 4096 2007-06-30 09:14 help
-rwxr-xr-x 1 admispconfig admispconfig 324 2007-06-30 10:30 index.php
drwxr-xr-x 2 admispconfig admispconfig 4096 2007-06-30 09:14 lang
drwxr-xr-x 2 admispconfig admispconfig 4096 2007-06-30 09:14 plugins
-rwxr-xr-x 1 admispconfig admispconfig 5 2007-06-30 10:30 preload.inc.php
-rwxr-xr-x 1 admispconfig admispconfig 10992 2007-06-30 10:30 session.inc.php
root@mail:~#

till
2nd July 2007, 10:39
Your mysqld is running but it seems not be able to accept connections.

Please stop mysql with its init script. If there is still a mysql process running when you check with netstat, then kill the mysql process with the "kill" command and start mysql again.

dayjahone
2nd July 2007, 16:34
I tried stopping and it was still running. I used the command "killall mysql" which stopped it. I then started mysql and restarted ISPConfig. I got the same error when restarting ISPConfig, and I still can't access the control panel on port 81. This happened when I rebooted the machine. Or did I mess up the tables when I copied everything from one drive to the other? I didn't stop mysql or ISPConfig before copying everything; however, it worked fine until I rebooted.



root@mail:~# killall mysqld
root@mail:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:2208 *:* LISTEN 4667/hpiod
tcp 0 0 *:www *:* LISTEN 683/apache2
tcp 0 0 *:ftp *:* LISTEN 5630/proftpd: (acce
tcp 0 0 mail.mydomain.co:domain *:* LISTEN 5595/named
tcp 0 0 localhost:domain *:* LISTEN 5595/named
tcp 0 0 localhost:ipp *:* LISTEN 4637/cupsd
tcp 0 0 localhost:953 *:* LISTEN 5595/named
tcp 0 0 *:smtp *:* LISTEN 821/smtpd
tcp 0 0 *:https *:* LISTEN 683/apache2
tcp 0 0 localhost:2207 *:* LISTEN 4672/python
tcp 17 0 localhost:smtp localhost:3113 CLOSE_WAIT -
tcp6 0 0 *:imaps *:* LISTEN 4909/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 4951/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 4926/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 4882/couriertcpd
tcp6 0 0 *:domain *:* LISTEN 5595/named
tcp6 0 0 *:ssh *:* LISTEN 5105/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 5595/named
tcp6 0 0 *:smtp *:* LISTEN 821/smtpd
tcp6 0 2592 mail.mydomain.com:ssh rockland-router3.:50028 ESTABLISHED728/0


root@mail:~# /etc/init.d/mysql start
* Starting MySQL database server mysqld
...done.
* Checking for corrupt, not cleanly closed and upgrade needing tables.

root@mail:~# /etc/init.d/ispconfig_server restart
Shutting down ISPConfig system...
/root/ispconfig/httpd/bin/apachectl stop: httpd (no pid file) not running
ISPConfig system stopped!
Starting ISPConfig system...
/root/ispconfig/httpd/bin/apachectl startssl: httpd could not be started
ISPConfig system is now up and running!


root@mail:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:2208 *:* LISTEN 4667/hpiod
tcp 0 0 *:mysql *:* LISTEN 899/mysqld
tcp 0 0 *:www *:* LISTEN 683/apache2
tcp 0 0 mail.mydomain.co:domain *:* LISTEN 1158/named
tcp 0 0 localhost:domain *:* LISTEN 1158/named
tcp 0 0 *:ftp *:* LISTEN 5630/proftpd: (acce
tcp 0 0 localhost:ipp *:* LISTEN 4637/cupsd
tcp 0 0 localhost:953 *:* LISTEN 1158/named
tcp 0 0 *:smtp *:* LISTEN 1204/smtpd
tcp 0 0 *:https *:* LISTEN 683/apache2
tcp 0 0 localhost:2207 *:* LISTEN 4672/python
tcp 0 0 localhost:ftp localhost:1716 TIME_WAIT -
tcp 0 0 localhost:1570 localhost:www TIME_WAIT -
tcp 17 0 localhost:smtp localhost:3113 CLOSE_WAIT -
tcp6 0 0 *:imaps *:* LISTEN 4909/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 4951/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 4926/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 4882/couriertcpd
tcp6 0 0 *:domain *:* LISTEN 1158/named
tcp6 0 0 *:ssh *:* LISTEN 5105/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 1158/named
tcp6 0 0 *:smtp *:* LISTEN 1204/smtpd
tcp6 0 3024 mail.mydomain.com:ssh rockland-router3.:50028 ESTABLISHED728/0

falko
2nd July 2007, 19:27
Are there any errors in the ISPConfig Apache error log in /root/ispconfig/httpd/logs?

dayjahone
2nd July 2007, 19:30
root@mail:~# vim /root/ispconfig/httpd/logs/error_log:

[Sat Jun 30 10:30:25 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 10:30:25 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Sat Jun 30 23:09:26 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 23:09:26 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Sat Jun 30 23:14:17 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 23:14:17 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Sat Jun 30 23:19:36 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 23:19:36 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Sat Jun 30 23:34:32 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 23:34:32 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Sat Jun 30 23:42:56 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Sat Jun 30 23:42:56 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Mon Jul 2 07:28:28 2007] [error] mod_ssl: Init: Unable to read server certificate from file /root/ispconfig/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Mon Jul 2 07:28:28 2007] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data

falko
2nd July 2007, 20:04
Your SSL certificate is corrupt. Please create a new one: http://www.howtoforge.com/forums/showthread.php?t=121

dayjahone
2nd July 2007, 20:44
Worked perfectly!

Is it OK if I just left it as "yourpassword" or do I need to change it?

falko
3rd July 2007, 16:40
Is it OK if I just left it as "yourpassword" or do I need to change it?
You can leave it as is.