apache and MySQL went down cant restart help

General support questions
Post Reply
oxonweb
Posts: 5
Joined: 2018/01/19 10:15:57

apache and MySQL went down cant restart help

Post by oxonweb » 2018/01/19 10:31:44

Hi all if some one could give advice it would be great.

running on Dedi server CPUIntel(R) Core(TM) i5-3570S CPU @ 3.10GHz Number :4Cache :6144 KBSpeed :3424 MHz RAM2 x 8192 MB CentOS Linux 7.4.1708

Basically all was fine last night but i had no space left on root folder so cleaned old files like old kernels and .giz files. In order to auto update a couple of files as normal.

now i see that the Apche and MySQL db is down and wont restart.

the errors i get are

Code: Select all

# apachectl configtest
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for main error log
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:771
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:692
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:599
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:507
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:432
(2)No such file or directory: AH02291: Cannot access directory '/var/log/virtualmin/' for error log of vhost defined at /etc/httpd/conf/httpd.conf:361
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for error log of vhost defined at /etc/httpd/conf.d/ssl.conf:56
AH00014: Configuration check failed
the file

Code: Select all

'/etc/httpd/logs/'
Is there so very odd??

But

Code: Select all

'/var/log/virtualmin/'
is MISSING when checking through file manager

also the Mysql is showing errors

Code: Select all

 Failed to start database :
Redirecting to /bin/systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
and MySQL is not running on your system - database list could not be retrieved.

The full MySQL error message was : DBI connect failed : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

hope that helps

I do still have webmin and SSH login if helps

thanks

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: apache and MySQL went down cant restart help

Post by TrevorH » 2018/01/19 11:05:39

You appear to have "cleaned up" rather more than you should have done. You've deleted the directory /var/log/virtualmin so you need to recreate that and chown it so that apache httpd can read/write it.

For /etc/httpd/logs, what is the output from rpm -V httpd ? If it lists any output other than config files then yum reinstall httpd - /etc/httpd/logs should be a symlink to ../../var/log/httpd so maybe you deleted that directory too?
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
And what is the output from those two suggested commands? And also look in /var/log/mariadb/mariadb.log for errors there too.

Hope you have backups of your database!
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: apache and MySQL went down cant restart help

Post by avij » 2018/01/19 11:29:52

Your database files should be in /var/lib/mysql. If that directory does not exist or is empty, you may need to restore your database from your backups.

oxonweb
Posts: 5
Joined: 2018/01/19 10:15:57

Re: apache and MySQL went down cant restart help

Post by oxonweb » 2018/01/19 12:14:07

Hi thanks so much for getting back to me re appreciate it

I did add folders and now only get this error

Code: Select all

 apachectl configtest
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for main error log
AH00014: Configuration check failed
and checked this

Code: Select all

rpm -V httpd
S.5....T.  c /etc/httpd/conf/httpd.conf
missing     /var/log/httpd
does that help ???

I did notice the the /etc/ folder has different attributes it has .....I...e where as all other folders in /ect/ are just .......e..

sorry dont know what that means or if need to change them

oxonweb
Posts: 5
Joined: 2018/01/19 10:15:57

Re: apache and MySQL went down cant restart help

Post by oxonweb » 2018/01/19 12:22:15

avij wrote:Your database files should be in /var/lib/mysql. If that directory does not exist or is empty, you may need to restore your database from your backups.
yes they are all still there thanks so thats good :D

oxonweb
Posts: 5
Joined: 2018/01/19 10:15:57

Re: apache and MySQL went down cant restart help

Post by oxonweb » 2018/01/19 12:29:10

TrevorH wrote:You appear to have "cleaned up" rather more than you should have done. You've deleted the directory /var/log/virtualmin so you need to recreate that and chown it so that apache httpd can read/write it.

For /etc/httpd/logs, what is the output from rpm -V httpd ? If it lists any output other than config files then yum reinstall httpd - /etc/httpd/logs should be a symlink to ../../var/log/httpd so maybe you deleted that directory too?
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
And what is the output from those two suggested commands? And also look in /var/log/mariadb/mariadb.log for errors there too.

Hope you have backups of your database!

Code: Select all

./var/log/httpd 
is there ??? with 4 files in access.log and 3 ssl.logs

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: apache and MySQL went down cant restart help

Post by TrevorH » 2018/01/19 13:32:39

missing /var/log/httpd
Disagrees with...
is there ??? with 4 files in access.log and 3 ssl.logs
You'll find that /etc/httpd/logs is or should be a symlink to ../../var/log/httpd so if /var/log/httpd is missing as rpm -V httpd reports then that would explain the problem.
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for main error log
Now it says "cannot access" not "not found". Did you set the ownership and permissions correctly? Try rpm --setperms httpd and rpm --setugids httpd which should correct that.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

oxonweb
Posts: 5
Joined: 2018/01/19 10:15:57

Re: apache and MySQL went down cant restart help

Post by oxonweb » 2018/01/19 13:44:18

TrevorH wrote:
missing /var/log/httpd
Disagrees with...
is there ??? with 4 files in access.log and 3 ssl.logs
You'll find that /etc/httpd/logs is or should be a symlink to ../../var/log/httpd so if /var/log/httpd is missing as rpm -V httpd reports then that would explain the problem.
(2)No such file or directory: AH02291: Cannot access directory '/etc/httpd/logs/' for main error log
Now it says "cannot access" not "not found". Did you set the ownership and permissions correctly? Try rpm --setperms httpd and rpm --setugids httpd which should correct that.
it was permissions thank you so much for you help and i also have to add a backup file as i had delete old files that where missing ( folders there but didnt looking in folder lol sorry must pay more attention thanks again for help

Post Reply