How to Disable Automatic Killed on Centos Server using Webuzo - mysql

I have some problems but sometimes my vps auto down, whenever httpd, apache, or mysql
sometimes I must restart my webuzo using
service webuzo restart
so I can see my site live again.
Why am I having this problem? Is server automatically down because of high used resource?
If so, how can I make command shell autogenerate command service restart?

Execute the following command and it should be running on reboot
// On CentOS
Root > chkconfig webuzo on
// On Ubuntu
Root > update-rc.d webuzo defaults
Hope it helps

Related

Change start-up options for mysqld in whm on CentOS

I have a WHM/Cpanel server set up on CentOS 7.6.
I need to set up my mysqld process with a start-up option --init-file, to be ran every time the service is restarted.
I assume there is a file somewhere on the server that tells WHM what options to use when starting the service mysqld. But I can't find it.
Thanks
Matt
Figured out that CentOS uses the systemd service initializer.
Answer:
Edit the mysqld.service file in
/usr/lib/systemd/system
Then you have to reload the systemctl daemon. Run command:
systemctl daemon-reload
Then restart mysql from WHM and it will execute the option

Not To Start MySql Automatically at Centos Startup

i have "CentOS 6" VPS and i wanted to start mysql service automatically at Startup of Server when it is restarted. so i used this command in putty
chkconfig --level 345 mysqld on
this command is working and mysql starts on every startup automatically.
BUT how can i now stop this? what if i want to start Mysql manually on every startup, then what command should i use?
also what is the File where i can see the list of programs that are running automatically on every setup.
Thanks
You can turn off auto-start with this command:
chkconfig --level 345 mysqld off
To see what is configured for auto-start, you can run:
chkconfig --list
See more info on chkconfig here:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-services-chkconfig.html

Zabbix server is not running: the information displayed may not be current

So all of a sudden, after a week of using it, I get an error message on my zabbix server gui (http://localhost/zabbix/.)
The error says: Zabbix server is not running: the information displayed may not be current.
Any idea why is this happening ll of a sudden and out of the blue? I restarted the machine - which should automatically restore the zabbix server upon startup - but it's still not running.
I also researched for a startup or restart command but true to form with zabbix helpful, clear documentation is non-existent.
EDIT:
Some more info:
MySQL is running normally. I'm able to select, insert into, whatever I want.
Doing /etc/init.d/zabbix-server status results in * zabbix_server is not running
The last entry in zabbix_server.log is Zabbix Server stopped. Zabbix 2.2.9 (revision 52686).
Doing sudo /etc/init.d/zabbix-server start results in * Starting Zabbix server zabbix_server but the status is still not running and the log file doesn't have any new entries.
just get into the zabbix.conf.php
>$sudo vim /etc/zabbix/web/zabbix.conf.php
>$ZBX_SERVER = '**your zabbix ip address or DNS name**';
>$ZBX_SERVER_PORT = '10051';
>$ZBX_SERVER_NAME = '**your zabbix hostname**';
just change the ip address you can resolve the error
Zabbix server is not running: the information displayed may not be current
After that restart the zabbix server
>$sudo service zabbix-server restart
To verify go to Dashboard Administration -> queue there you see data
i resolved my error like this works fine for me.
To solve the problem zabbix server is not running you have to :
First - Check that all of the database parameters in zabbix.conf.php ( /etc/zabbix/web/zabbix.conf.php) and zabbix_server.conf ( /etc/zabbix/zabbix_server.conf) to be the same. Including:
• DBHost
• DBName
• DBUser
• DBPassword
Second- Change SElinux parameters:
#setsebool -P httpd_can_network_connect on
#setsebool -P httpd_can_connect_zabbix 1
#setsebool -P zabbix_can_network 1
After all, restart all services:
#service zabbix-server restart
#service httpd restart
worth a try.
Edit this file: sudo nano /etc/default/zabbix-server
Adjust the START property to yes:
START=yes
Then try to run Zabbix again: sudo service zabbix-server start
This may happen because of the old and new IP address
I have faced same issue which was solve by below method:
vim /etc/zabbix/web/zabbix.conf.php
$ZBX_SERVER = new ip address
then restart zabbix server
I was using a special character in my DB password - wrapping the DBPassword option in /etc/zabbix/zabbix_server.conf and doing sudo service zabbix-server restart got me back up and running.
Not Working
DBPassword=MyString?
Working
DBPassword='MyString?'
Solution might be this simple:
sudo su
nano /etc/zabbix/zabbix-server.conf
Remove "#" in front of DBPassword=YourPassword (will change from blue to grey)
Ctrl x (Y to save and press enter to exit)
service zabbix-server restart
Now you can refresh your browser running ZABBIX. If not, you will have to do the same steps for CacheSize=32M
You do not have to change anything in /etc/zabbix/web/zabbix.conf.php (localhost is fine)
When editing anything, remember "#" in front of line means invisible to linux.
As Zabbix Senior Instructor and Consultant Hernandes Martins says in his "Zabbix server is not running what to do?" blog post:
This is the first step that should be checked regardless of the situation, always view the logs, from the moment the error message appeared in the zabbix web interface always view the log.
By following his advice I could be able to identify the cause of the issue with my Zabbix server, and then apply the solution related to the specific problem.
In my case, as I've commented in the page:
The problem in my server was of "4. Resource Allocation Issues". Just like you wrote above, Zabbix was showing out of memory errors on the log when trying to start the server.
After increasing the value of parameter CacheSize I tried to restart the service, but it didn't respond. So, I ended up restarting the whole machine. Fortunately, in the end it resolved the problem for good.
So, take a look at the log with command tail -f /var/log/zabbix/zabbix_server.log on the terminal/prompt, watch for any errors, and tackle the problem according to what it makes sense for your particular case.
Looks like the problem was that I created a Database monitoring Item programmatically and it triggered a bug that caused the server to shutdown.
Once I deleted the item the server came back up, and creating subsequent Items didn't kill it.
The deadly Item had a value_type of Numeric unsigned, -1 programmatically, while the newly created Items have a value_type of float, which is 0 programmatically.
The whole thing has a voodoo element to it but it did solve my problem.
Maybe is configuration issue
nano /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix_db
DBUser=zabbix_user
DBPassword=XXXXXXX
works for me on Zabbix 3.0 Centos 7
The zabbix-server daemon doesn't seem to like passwords with special characters in them. Unsure whether quotes would work in the configuration I just removed special characters from the database password, updated the configuration files and restarted the daemon.
Configuration parsing errors don't show up in logs for some reason.
Install nmap (( # yum/apt-get install nmap ))tool and check to find out which port the zabbix is listenning to?(( # nmap -sT -p1-65535 localhost )) 10050 or 10051?
The result should be somthing like this:
Starting Nmap 6.40 ( http://nmap.org ) at 2016-11-01 22:54 IRST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00032s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 65530 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
3306/tcp open mysql
10050/tcp open unknown <--- In my case this is it
Then open /etc/zabbix/web/zabbix.conf.php and check the line starting with: $ZBX_SERVER_PORT , it's value should be the same number you saw in the nmap scan result. Change it and restart zabbix-server and httpd and you are good to go!
There maybe IP address conflict, try host 'Zabbix server'
On RHEL/CentOS/OEL 6
Check that the firewall is allowing connection to Zabbix Server port which is 10051, as a user with root priv:
vi /etc/sysconfig/iptables
and add the following lines
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT
restart iptables
# service iptables restart
If you have disabled IPV6, you need to also edit the hosts file and remove IPV6 line for "localhost"
# vi /etc/hosts
remove or comment out "#" the ipv6 line for localhost
::1 localhost6.localdomain6 localhost6
restart the zabbix-server and check if the error message is gone.
I was in the same trouble.
For my case, that was a conflict between /etc/zabbix/zabbix_agentd.conf and zabbix_server.conf parameters.
I adjusted
"DBHost=localhost",
"DBName=zabbix",
"DBUser=zabbix",
"DBPassword=******",
"DebugLevel=3"
"ListenPort".
If you run the default installation, you should keep ListenPort=10051 for the server and 10050 for the agent.
Cheers!
In my case it happens when introducing host with templates, graphs,trigger etc, the server falls.
The problem was that by default the cache is at 128k and you have to change it.
sudo nano /etc/zabbix/zabbix-server.conf
Uncheck # Sizecache and add 32M for example.
Cachesize=32M
restart service and voila!! server working
service zabbix-server start
My problem was caused by having external ip in $ZBX_SERVER setting.
I changed it to localhost instead so that ip was resolved internally,
$sudo nano /etc/zabbix/web/zabbix.conf.php
Changed
$ZBX_SERVER = 'external ip was written here';
to
$ZBX_SERVER = 'localhost';
then
$sudo service zabbix-server restart
Zabbix 3.4 on Ubuntu 14.04.3 LTS
I had the same issue.
I forgotten selinux conf, not all is ok:
setsebool -P httpd_can_connect_zabbix on
In my case, this occurred because the password in the server config file was commented out.
Open the server config file: # sudo vim /etc/zabbix/zabbix-server.conf
Scroll down to db user and below there will be the password with a # commenting out. Remove the hash and insert your DB password.
In my case i had to disable Linux SE
[root#webserverlocaldomain /]# setenforce 0
Disable Firewall
[root#webserverlocaldomain /]# systemctl stop firewalld
Edit config file uncommenting#
[root#webserverlocaldomain /]# vi /etc/zabbix/zabbix_server.conf
ListenPort=10051
DBHost=localhost
DBPassword=password
Then restart the services
[root#webserverlocaldomain /]# systemctl restart zabbix-server zabbix-agent httpd
#getsebool -a
//httpd_can_network_connect off
#setsebool httpd_can_network_connect on
#getsebool httpd_can_network_connect
#service zabbix-server restart
in my case after installing zabbix from sources (removed zabbix 4.0 because upgrading to 4.2 wasn't possible via apt on a Raspbian GNU/Linux 9.4 stretch) it loaded the config from /usr/local/etc/zabbix_server.conf instead from /etc/zabbix/zabbix_server.conf
After deleting /usr/local/etc/zabbix_server.conf and creating a symlink pointing to the correct config file in /etc/zabbix/zabbix_server.conf it started to work
I solved this problem on Ubuntu 18.04 by uninstalling Zabbix and reinstalling it again from scratch.
The initial installation didn't work because I had followed old posts/guides/tutorials, even from Zabbix documentation itself, so these might probably be outdated. So, the trick was to find and follow the most updated guide to Zabbix installation from its docs.
Here are the two links I followed for uninstalling and reinstalling Zabbix:
How to uninstall Zabbix: https://www.quora.com/How-do-I-uninstall-Zabbix-server-agent-in-Ubuntu
How to (properly) install Zabbix: https://www.zabbix.com/download?zabbix=4.0&os_distribution=ubuntu&os_version=18.04_bionic&db=postgresql
When installing Zabbix from the link above, your choosen Zabbix Version, OS Distribution, OS Version or Database may be different from the ones I've selected, but following the instructions on this page will probably be also the right way for you to install your chosen Zabbix configuration without getting errors post installation.
Never had the problem until it suddenly appeared once, for me, the solution was to add (uncomment) the following line in /etc/zabbix/zabbix_server.conf
ListenIP=0.0.0.0
i had similar problem and my gui reported problem with cache, i change it zabbix-server.conf to 32M and now is ok, zabbix is an intelligent tool, please if it possible check problems in gui first. I had to much hosts ... for default cache.

php5-msql installed on Ubuntu but not shown in phpinfo.php

I am setting up Nginx+PHP+MYSQL on Ubuntu 12.04.
I used
apt-get install php5-mysql
to install MySql module for PHP. However, everything seems to be installed and enabled, it is yet shown in phpinfo.php and I cant get the php application to connect to the MySql server. The php app is accessible, and I can view things on phpinfo.php.
BTW, mysql is running normally, because I am running an Rails app using it, so I know it is working fine.
As #vstm said a quick summary to help others get the answer quicker:
1. Kill php-cgi
killall php-cgi
2. Restart php-fpm
/etc/init.d/php5-fpm restart OR service php5-fpm restart
3. Double check with
grep -E 'extension=(pdo_)?mysql.so' -r /etc/php5

Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I am running a Rails app so now I am trying to remote connect to MySQL and I am getting this error:
Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 0
You might want to check your /etc/hosts.deny where:
ALL: ALL: DENY
or
mysqld: ALL: DENY
is your enemy.
Rebooting the server worked for me. No settings changes needed.
check from that host
shell> telnet IP 3306
If MySQL is up and reachable you'll see mysql version in telnet output.
Otherwise check firewall, etc until telnet succeeds.
Then I advice you first connect with native mysql client to exclude Rails from problem aria.
Enable remote access.
The MySQL server does not listen on the TCP port 3306 by default. To allow (remote) TCP connections, comment the following line in /etc/mysql/my.cnf:
skip-networking
Remember to edit /etc/hosts.allow by adding the following lines:
mysqld: ALL : ALLOW
mysqld-max: ALL : ALLOW
You need to edit your mysql Configuration file, by default the bind-adress is set to 127.0.0.1.
Open: /etc/mysql/my.cnf
Change the bind-adress to the ip you are going to use to connect yoursef to the database server.
Using OS X? Does this issue go away for a while after mysqld restart and then re-appear? Check mysql server logs when getting these errors. I'm seeing a bunch of entries like below:
2019-01-30T17:34:04.009979Z 0 [Warning] File Descriptor 1564 exceeded FD_SETSIZE=1024
This error points to potential solutions:
https://expressionengine.com/blog/mysql-5.7-server-os-x-has-gone-away https://wilsonmar.github.io/maximum-limits/
One of them is adding following setting to my.cnf
[mysqld]
table_open_cache=250
Nobody has seemed to answer this, and it appears to have re-emerged as an issue nearly 7 years after originally being filed. I saw this on Rails app running Capybara (using phantomjs), my integration specs (only) would intermittently fail with this.
Restarting the machine temporarily fixed the problem.
I then imploded my MySQL installation completely (see https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x) and re-installed it using homebrew. The problem appears to have gone away but I will update this answer if it comes back.
to implode your MySQL install completely (from https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x):
Open a terminal window
Use mysqldump to backup your databases to text files!
Stop the database server
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
As we all know there are many different ways to install and configure mySQL dbms (database managment system) on our machines besides the fact we all run different OS (linux, osx, win$hit, etc)
In my case in particular i was getting
connect': Lost connection to MySQL server at 'reading initial communication packet', system error: 102 (Mysql2::Error)
BUT i did not even had /etc/hosts.deny i only had /etc/hosts because i installed mySQL on my OSX machine using simple GUI OSX app
MySQL instance status was NOT OK above's image is just a reference for MySQL OSX APP.
Simple server re-start solved the issue.(in my case had to reboot my machine but that involves rebooting the MySQL server)
I was finally able to reach my localhost instance just fine again, did not had to change, create single file.
Hope this helps, i see Malcolm's answer and comments and made me think it was good to post this.
OS: macOS
MySQL version: 5.7
Killed the current mysql service process
mysql.server stop
and started it again
mysql.server start
This solve the issue for me.
mysqld-max: ALL : ALLOW
solved the problem for me.
Thank you guys for your effort, I have found the solution, I was suppose to set Remote Connection to MySQLhere is the link for someone who got the same error
http://benrobb.com/2007/01/15/howto-remote-root-access-to-mysql/