LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-18-2012, 06:26 AM   #1
RP86
LQ Newbie
 
Registered: Mar 2012
Posts: 4

Rep: Reputation: Disabled
Linux help


New member here, Im a total newb to Linux. Got a question, hopefully someone can help.

Basically at my establishment the old IT member was application developer and built a system to run reports and built portal systems to log information by the users. He has since left, he had one server running apache and the other running mysql. We had a power outage last week and the linux server shutdown, and now the linux box isn't running the reports anymore, they come up blank. Do I have to re-establish the connection between apache and MySQL with a command in linux ? I can access the database (phpmyadmin) no issues and use putty to connect to the box no issues as well.

Any help is appreciated, Thanks.
 
Old 03-18-2012, 10:16 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Hi, RP86, and welcome to LQ.

Your first thing to learn is that web search engines are your friend. Use them wisely and frequently. Choose your favorite search engine and search for "linux apache mysql php" also referred to as LAMP. You will find much information about installing, setting up, and connecting together the LAMP applications.

Unless you are using bleeding edge tech, most questions you may ask have already been answered and can be found by a web search. You will also usually have your answer sooner than you would by waiting for a response in a forum.
 
Old 03-18-2012, 04:19 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by RP86 View Post
New member here, Im a total newb to Linux. Got a question, hopefully someone can help.

Basically at my establishment the old IT member was application developer and built a system to run reports and built portal systems to log information by the users. He has since left, he had one server running apache and the other running mysql. We had a power outage last week and the linux server shutdown, and now the linux box isn't running the reports anymore, they come up blank. Do I have to re-establish the connection between apache and MySQL with a command in linux ? I can access the database (phpmyadmin) no issues and use putty to connect to the box no issues as well.

Any help is appreciated, Thanks.
Don't know, but a good place to look would be the Apache logs (usually in /var/log/apache2). You don't tell us what version/distro of Linux you're using, so it's hard to give specifics. The Apache error logs will typically (?) have something in them, if a connection to something has failed. Some basic diagnostic steps would be:
  • Go to the Apache server, and open a terminal window. Can you ping the MySQL server from the Apache server, and vice-versa? And be sure you ping them with both the hostname AND the IP address. The program could very well have a hostname hard-coded, but if the name won't resolve to an IP, it'll die.
  • If the ping test works, try restarting MySQL (as root on the MySQL box, issue "/etc/init.d/mysql restart"), THEN on the Apache box ("/etc/init.d/apache2 restart"). Make sure the services come up with no errors, and check the logs for hints if they do
  • Do the boxes pass through any firewalls/routers? Did THEY go down too? If the MySQL port was opened and the rule wasn't committed to the firewall, it'll now be blocked. Get your network admins to check that.
Past basic connectivity tests and firewall checks, the log files should give you a direction. After that, you may have to dig into the code. Post back if you find something, and we can try to help from there.
 
1 members found this post helpful.
Old 03-27-2012, 02:15 PM   #4
RP86
LQ Newbie
 
Registered: Mar 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Don't know, but a good place to look would be the Apache logs (usually in /var/log/apache2). You don't tell us what version/distro of Linux you're using, so it's hard to give specifics. The Apache error logs will typically (?) have something in them, if a connection to something has failed. Some basic diagnostic steps would be:
  • Go to the Apache server, and open a terminal window. Can you ping the MySQL server from the Apache server, and vice-versa? And be sure you ping them with both the hostname AND the IP address. The program could very well have a hostname hard-coded, but if the name won't resolve to an IP, it'll die.
  • If the ping test works, try restarting MySQL (as root on the MySQL box, issue "/etc/init.d/mysql restart"), THEN on the Apache box ("/etc/init.d/apache2 restart"). Make sure the services come up with no errors, and check the logs for hints if they do
  • Do the boxes pass through any firewalls/routers? Did THEY go down too? If the MySQL port was opened and the rule wasn't committed to the firewall, it'll now be blocked. Get your network admins to check that.
Past basic connectivity tests and firewall checks, the log files should give you a direction. After that, you may have to dig into the code. Post back if you find something, and we can try to help from there.
Hey T-Bone,

Thanks for the reply. Like I said i'm new to Linux, its running Debian GNU/Linux 5.0. I have already restarted the apache server and the MySQL server using those command before, however a power outage happened and our UPS didn't function correctly and only the apache box ended up shutting down the MYSQL stayed up and ever since the right services have not been running. Our apache server is 10.2.25.19 and our SQL server is 10.2.25.20, and I am able to ping both the hostname and IP from both servers. I did what you said about the log files, however there seems to be a ton of gzip files and a few I am able to read. Here is the files in that directory

access.log
access.log.1
access.log.19.gz
access.log.2.gz
access.log.3.gz
error.log.11.gz
error.log.22.gz
error.log.32.gz
error.log.5.gz
access.log.20.gz
access.log.30.gz
access.log.40.gz
error.log.12.gz
error.log.23.gz
error.log.33.gz
error.log.6.gz
access.log.10.gz
access.log.21.gz
access.log.31.gz
access.log.4.gz
error.log.13.gz
error.log.24.gz
error.log.34.gz
error.log.7.gz
access.log.11.gz
access.log.22.gz
access.log.32.gz
access.log.5.gz
error.log.14.gz
error.log.25.gz
error.log.35.gz
error.log.8.gz
access.log.12.gz
access.log.23.gz
access.log.33.gz
access.log.6.gz
error.log.15.gz
error.log.26.gz
error.log.36.gz
error.log.9.gz
access.log.13.gz
other_vhosts_access.log
other_vhosts_access1.log

Anyone of these that would have the information ? when I 'pico' to read the file it only displays so much information and I can't read the rest, is there a way to pause the screen ?

Thanks
 
Old 03-27-2012, 02:37 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by RP86 View Post
Hey T-Bone,
Thanks for the reply. Like I said i'm new to Linux, its running Debian GNU/Linux 5.0. I have already restarted the apache server and the MySQL server using those command before, however a power outage happened and our UPS didn't function correctly and only the apache box ended up shutting down the MYSQL stayed up and ever since the right services have not been running. Our apache server is 10.2.25.19 and our SQL server is 10.2.25.20, and I am able to ping both the hostname and IP from both servers. I did what you said about the log files, however there seems to be a ton of gzip files and a few I am able to read. Here is the files in that directory

access.log
error.log.9.gz
access.log.13.gz
other_vhosts_access.log
other_vhosts_access1.log

Anyone of these that would have the information ? when I 'pico' to read the file it only displays so much information and I can't read the rest, is there a way to pause the screen ?
Hmm...the 'normal' logs that I have are in /var/log/apache2, and are named access_log, error_log and (in my case) ssl_request_log. The .gz files are probably older logs that have older info in them. Can you get a web page up on the apache server at all?? Even the default "it works!" page would show you apache is up and running. You can copy the log file to a different file name, or use something like "tail access.log" (that would show you the last bit of the file). It's just text, too, so you can copy it to a different file name, and open it with whatever editor you like (vi, emacs, gedit, or even OpenOffice).

Honestly, the logs can be ANYWHERE, and called anything...do an "ls -l" to see the long listing, with dates/times of last modification. But without pulling through the configs and finding the logs, and going from there, it can be complicated. If time is of importance to your company, I'd suggest getting a consultant to help you with this...it's something that can be pulled through (even the PHP code, if need be), in one day to figure out where things are going, and get them up again. A big benefit to you would be, the process would be documented for later, so you'd not be in this situation again.

Not saying you can't figure it out, and that we won't work with you...but that is a quick way out for your company.
 
1 members found this post helpful.
Old 03-27-2012, 05:22 PM   #6
RP86
LQ Newbie
 
Registered: Mar 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Hmm...the 'normal' logs that I have are in /var/log/apache2, and are named access_log, error_log and (in my case) ssl_request_log. The .gz files are probably older logs that have older info in them. Can you get a web page up on the apache server at all?? Even the default "it works!" page would show you apache is up and running. You can copy the log file to a different file name, or use something like "tail access.log" (that would show you the last bit of the file). It's just text, too, so you can copy it to a different file name, and open it with whatever editor you like (vi, emacs, gedit, or even OpenOffice).

Honestly, the logs can be ANYWHERE, and called anything...do an "ls -l" to see the long listing, with dates/times of last modification. But without pulling through the configs and finding the logs, and going from there, it can be complicated. If time is of importance to your company, I'd suggest getting a consultant to help you with this...it's something that can be pulled through (even the PHP code, if need be), in one day to figure out where things are going, and get them up again. A big benefit to you would be, the process would be documented for later, so you'd not be in this situation again.

Not saying you can't figure it out, and that we won't work with you...but that is a quick way out for your company.
Yea I can launch the webpage, its just the data is not being accessed through MySQL for our portal systems (ie. Database of all employees are not showing up in employee portal). I will begin to try reading through some of the logs. Thanks again for your help.
 
Old 03-27-2012, 05:53 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, the current/latest apache logs would be the ones with no extension ie access_log (just shows which pages people are using) and error_log (shows errors sic for attempted cxns).
The apache conf files should show where the php progs live; something like /var/www/cgi-bin (possibly) and you should search (try the grep tool) for connect strings; see examples here http://php.net/manual/en/function.mysql-connect.php
Incidentally, example grep
Code:
grep some_string filename
If you are taking over as the Admin, you may find these links useful

http://rute.2038bug.com/index.html.gz
http://www.linuxtopia.org/online_boo...ion_index.html - see Debian books there
http://linux.die.net/man/ - searchable manual pages
http://www.howtoforge.com/ubuntu_debian_lamp_server - Debian LAMP (Linux/Apache/MySQL/PHP) setup howto
https://httpd.apache.org/
https://dev.mysql.com/doc/refman/5.1/en/index.html
 
Old 03-27-2012, 08:09 PM   #8
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
I would look in /etc/init.d for an application server. It sounds like one might need to be started especially if the reports were written in Java. Some common ones are tomcat and jboss. You may just need to start the service for that part of your web page.
 
1 members found this post helpful.
Old 03-28-2012, 05:16 AM   #9
mericet
Member
 
Registered: Jul 2009
Posts: 50

Rep: Reputation: 8
Quote:
Originally Posted by bigrigdriver View Post
Hi, RP86, and welcome to LQ.

Your first thing to learn is that web search engines are your friend. Use them wisely and frequently. Choose your favorite search engine and search for "linux apache mysql php" also referred to as LAMP. You will find much information about installing, setting up, and connecting together the LAMP applications.
Replies like that are annoying.
There are lots of them or lots of forums, and when one actually DOES Google the problem, most of the search results are merely variations of 'use Google', and that's about as useful as a chocolate teapot.
 
1 members found this post helpful.
Old 03-28-2012, 06:31 AM   #10
RP86
LQ Newbie
 
Registered: Mar 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the reply guys, no luck still. However I went onto the phpmyadmin and one of our tables is crashed and needs repaired. I get this error:

MySQL said:

#144 - Table './AVP/Vms_Extractions' is marked as crashed and last (automatic?) repair failed

I ran REPAIR TABLE Vms_Extractions;

it runs it, but the table has over a million records, and it takes forever (ran for over 5 hours) and causes freezing on the apache server. Is there a way I can repair it without having this issue ?

Much appreciated.
 
Old 03-28-2012, 07:13 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Not if the Apache is basically a web front end for the DB ... which it certainly sounds like ... think about it

Welcome to the wonderful world of the SysAdmin; I REALLY recommend someone is designated as the SysAdmin (even if you bring in an outside company).
See the links in my prev post #7.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration