Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running a dedicated server on the latest version of CentOS7. I am using it for running 6 websites, based on different script (pinterest clone script, tube script, picture galleries script, vBulletin forum, Wordpress blogs). The overall traffic to the sites is low, only about 1,000 hits per day (if not less at this point).
I rsynced all the sites to here, moved the database files also, and I would be trying to get a general view of how everything works and if it works correctly, here. I am having some issues with vBulletin connecting to a MariaDB database now, one other thing does not work, and I will be checking for other errors too.
In general, I would like to run the sites for like 24 hours, lets say, and get a good general view of the system, and what is going on. What error logs (besides the most obvious /var/log/httpd/error_log; I only use Apache, I dont have Nginx or anything else here) would I check to get a good info, and also what default settings should I change? For example, I have an issue with the MariaDB, and this does not log any info by default, as far as I know (I looked into /var/log/mariadb/mariadb.log, and there is nothing there). I started reading about it on the Net and people mention journalctl (command), but no good info there for this.
This is probably all very easy in the end, but it would be helpful to set up things in a certain way.
So how would I get that good view of what is going on, and knock of all the errors / issues, and things like this..
1) httpd error_log - this is the first place to go
2) Enable MariaDB logging in some way, change the default settings. Would you know about any good articles about it on the Net, something that I could follow and use
3) journalctl command, would this be of any use, how?
4) Are there any other places that I would check?
I have logwatch installed, and I get an email everyday, but I have not been using this program too much yet (I am fairy new to all this).
So in general, the latest CentOS7, not a bad hosting plan (SoYouStart.com, $42 per month), 6 websites on different scripts (good quality, except for one, 1,000 hits), and I want to get the full view of what is going on, and probably fix some things.
###Edit:
I could probably switch the logging level in /var/log/httpd/error_log. One script is not very good, and there is a lot of PHP notices there, I probably have close to 500,000 or more lines there after several days of logging. So if it would be better to change the logging level so I have only the most important info, this would be good too, but I am not sure if this is a recommended thing.
This is probably all very easy in the end, but it would be good to set up these things in a certain way, and work on it in a certain way too. Set it up good, check certain places once per day at the beginning, look at the info there, fix the issues, and dont even come back to it after this is done. Maybe check the logwatch emails every couple of days (with this traffic), or even less.
Last edited by AdultFoundry; 06-22-2016 at 04:51 AM.
MariaDB logging is disabled by default, as the sources say on the Internet. From what I've been working on now, it logs [mysqld_safe] to /var/log/mariadb/mariadb.log by default / out of the box. I've been reading some sources on the Net now (I will put the links on the bottom), and based on that I did that.
I have MariaDB error log for [mysqld_safe] and [mysqld] going to a new file called /var/log/mariadb/mariadb_error.log
I have enabled a slow query log going to /var/log/mariadb/mariadb_slow.log, with the following settings:
I did not enable the General Query Log, as this logs the MariaDB queries, and this may not be needed, considering the fact that this is taking a lot of unnecessary storage space.
So this part can be definitely tuned, as you have error log for Apache, and now you have a general error log for MariaDB which does not work on the system out of the box.
So MariaDB is in general - Error Log, General Query Log, Slow Query Log (and this comes with mysqld_safe, mysqld, not just one thing). The third one can be enabled too.
###
@TenTenths - I used to have sysstat on the previous system, but I have omitted it here, I may install it later on. This may be useful when I have more traffic, and not just like 1,000 people per day. The more I install the more resources it uses too.
Last edited by AdultFoundry; 06-22-2016 at 05:55 AM.
@TenTenths - I used to have sysstat on the previous system, but I have omitted it here, I may install it later on. This may be useful when I have more traffic, and not just like 1,000 people per day. The more I install the more resources it uses too.
sysstat/sar has a minimal resource "impact". Number of users has nothing to do with what happens "behind the scenes", for example here's the SAR output from a server that doesn't have any users: Care to guess when the database backup script runs?
Code:
# sar
Linux 3.10.0-327.el7.x86_64 ([renoved]) 22/06/16 _x86_64_ (8 CPU)
00:00:01 CPU %user %nice %system %iowait %steal %idle
00:10:01 all 0.02 0.00 0.01 0.00 0.01 99.96
00:20:02 all 5.61 0.00 0.48 1.82 0.03 92.06
00:30:01 all 6.24 0.00 0.09 0.12 0.01 93.54
00:40:01 all 0.01 0.00 0.01 0.01 0.01 99.95
00:50:01 all 0.01 0.00 0.01 0.00 0.01 99.97
01:00:01 all 0.01 0.00 0.01 0.00 0.01 99.97
01:10:01 all 0.07 0.00 0.03 0.03 0.03 99.84
01:20:01 all 0.11 0.00 0.04 0.00 0.05 99.79
01:30:01 all 0.06 0.00 0.02 0.00 0.03 99.89
01:40:02 all 0.01 0.00 0.01 0.00 0.01 99.96
01:50:01 all 0.02 0.00 0.01 0.01 0.01 99.96
Ok, maybe I can get any info about that. I used to have a vBulletin 5 (the latest version) forum on a good managed hosting plan (shared). I did a mysqldump from ssh chroot jail (not that it matters), and I imported it with mysql -u -p <database_name> < file_name.sql. I got an error like this:
Code:
ERROR 2006 (HY000) at line 23048: MySQL server has gone away
This was suppose to be related to max_allowed_packet setting in /etc/my.cnf, so I changed that to like = 500M, and the import worked. The script does not seem to be working with the database though. MariaDB is working and the config file (database connection details) is correct / good.
The vBulletin database stores the actual image files in the database files, and this is how it was set on the previous hosting and here too (I did not change any settings at any time) so this is something new too. The error / issue may be related to this, but I am not sure. In the end I exported and imported the database without any errors / issues after this setting was changed, but it now does not work. I have a topic on their support forum too.
I've been basically stuck for like 10 days now, doing different things like this, and I would like to come back to working on the sites... But also, check all the sites, make sure that everything works (I have more things that dont work too).
I've been basically stuck for like 10 days now, doing different things like this, and I would like to come back to working on the sites... But also, check all the sites, make sure that everything works (I have more things that dont work too).
More things that don't work? Make a list. Welcome to SysAdminLife. Make Coffee.
What does "working on sites" mean if they are up and running? Aren't you the pr0n editor-in-chief?
You're stuck because it's not clear if you ever had a plan.
Wordpress migrations are always problematic.
For Wordpress "testing" an old site on a new host.
On the new host for wordpress, edit /etc/hosts and append this to the contents.
Code:
xxx.xxx.xxx.xxx domain.tld
where xxx. is the new IP of the wordpress site.
save and exit /etc/hosts
Edit wp-config.php of the site on the new host:
Add
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.