Archive for the ‘Distributions’ Category
The easiets way to change the hostname on CentOS 7 is to use the hostnamectl command.
First I will check the current hostname by running "hostnamectl status" on the shell of my server:
The output on my system is:
[root@server1 ~]# hostnamectl status Static hostname: server1.example.com Icon name: computer-vm Chassis: vm Machine ID: d89865d34b5a4637a9a4ff0ce0f6da02 Boot ID: 56d1685056d743b39e57a7b9cbfe467c Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64
Then I change the hostname with the set-hostname option of the hostnamectl command to server2.example.com
hostnamectl set-hostname server2.example.com
Afterwats I check with the command hostname and hostname -f if the hostname change has succeeded.
The result should be:
[root@server1 ~]# hostname server2.example.com [root@server1 ~]# hostname -f server2.example.com
Instead of the hostname command you could also use the "hostnamectl status" command again to check if the new hostname has been set:
[root@server1 ~]# hostnamectl status Static hostname: server2.example.com Icon name: computer-vm Chassis: vm Machine ID: d89865d34b5a4637a9a4ff0ce0f6da02 Boot ID: 56d1685056d743b39e57a7b9cbfe467c Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64
The Following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System.
sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases
mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases
The benefot of the above comand is that it uses the debian-sys-maint login to MySQL which is available on every Debian and Ubuntu System, so you dont have to provide the MySQL root login details.
1.1 SCP Command Line-An Overview
The SCP command line is commonly used to copy files over SSH, and between popular Operating systems like Linux, Mac and Windows in a secure fashion. SCP is used to copy files to/from a remote server. It also allows you to copy files from one remote server to another remote server, without passing traffic through your PC.
When you get the error message "system-config-firewall: command not found" on your CentOS Server while trying to configure the firewall on the shell, then the text interface version of the firewall configuration utility is missing. Install it with this command:
yum install system-config-firewall-tui
If your mail server stops working (neither incoming nor outgoing email works) and you find the following error message in the mail.log file:
fatal: open database /var/lib/postfix/smtpd_scache.db: File exists
then the smtpd_scache.db might got corrupted. Postfix will recreate this file, if it does not exist. So it can be removed to solve the issue:
rm -f /var/lib/postfix/smtpd_scache.db
Thanks to Alexander Fox for sending me this FAQ.
Solution for dovecot error: /path/ is no longer mounted. If this is intentional, remove it with doveadm mount
Dovecot is watching the whole server filesystem for modifications and removed or added sub filesystems. If you get errors similar to this one on your server:
Aug 30 09:10:23 server1 dovecot: master: Warning: /var/www/clients/client1/web1/log is no longer mounted. If this is intentional, remove it with doveadm mount
(the directory path may vary), then you can fix it by excluding the path from being watched by dovecot. In my case, dovecot shall not watch my website directories as they do not contain any mailboxes
Run the following command on the shell as root user:
doveadm mount add '/var/www/*' ignore
To exclude all files and folders in /var/www from deovecot monitoring.
If you work on a dual boot system you might experience that when you log off from Windows, onto Linux, and to Windows again, the time that is shown in the bottom right corner might be an hour or more off the actual time. This will correct once you refresh it by loading the time from a time server again but will remain an issue for the next logins.
This has not directly to do with daylight savings or an incorrect time zone, but most likely with Linux assuming that the BIOS time is set to UTC while it's set to local time. So it just changes the BIOS clock according to that. Logging in to Windows with the wrong BIOS clock will result in a wrong system time.
This Linux behavior can easily be changed though, so just login to your Linux system and open a command line. First log in as root with your password:
Then enter following to open the rcS file (note that I use vi as text editor - you can use any other you like here):
Now look for the line reading UTC = yes and change it to UTC = no. Save the file and try to boot into Windows - if every other time setting is set correct you should get the right time now.
With Steam support for Linux, there will most likely be a whole lot more games coming out for Ubuntu and its consorts. While the database of games with Linux support still grows, many titles are already available.
To install Steam on Ubuntu or Linux Mint, open a Terminal and enter the following commands:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B05498B7
sudo sh -c 'echo "deb http://repo.steampowered.com/steam/ precise steam" >>
sudo apt-get update
sudo apt-get install steam
Afterwards start it with
Solution for amavisd error – TROUBLE in process_request: Error writing a SMTP response to the socket: Broken pipe – on OpenVZ server
If you get error messages from amavisd similar to the one posted below on a server which is virtualized with OpenVZ:
Mar 5 09:09:02 v100 amavis: (17378-14) (!!)TROUBLE in process_request: Error writing a SMTP response to the socket: Broken pipe at (eval 100) line 987, <GEN44> line 31.
then the issue can be caused by the NUMTCPSOCK value in the openvz limits. Even if the barrier of this limit was never met in /proc/user_beancounters, the above error occurs when more then 25% of all TCP sockets were used. The solution is to set the NUMTCPSOCK barrier and limit to a high value in the openvz container configuration file. Here a value that worked for me on a moderately used mailserver:
Finally restart the OpenVZ VM to apply the new limit value.
If you use the apache mod_security module on your apache server, you might encounter wrong 403 errors for several URL's of the cms systems. Here are some exception rules to avoid that:
For WordPress Blogs
For the ModX CMS
SecRuleRemoveById 300013 300014 300015 300016
SecRuleRemoveById 300013 300016
Add these rules inside the vhost file of the website. If you use ISPConfig to manage the server, then add the rules in the apache directives field of the website settings in ispconfig.
Many thanks to PlanetFox for providing the rules.