Author Archives: sushant

Error restoring a particular database

[root@OK1053 mysql]# mysql uulimain_testagain < /home/uulimain/public_html/uulimain_testagain.sql
ERROR 1067 (42000) at line 242: Invalid default value for ‘up_to_date_as_of’

For this error need to cross check the mysql version of database backup from where is imported and also the mysql version on the current server, if both are same database will restore.

CGI download issue

Enable CGI through .htaccess

To enable CGI through .htaccess, perform the following steps:

  1. Log in to your server as the root user via SSH.
  2. Change to the /usr/local/apache/conf/ directory.
  3. Create a backup of your httpd.conf file. For example:

Note: In this example, http-old.conf represents the backup file’s name.

4. Open your http.conf file with a text editor and locate the section of the file that resembles the following example:

1 2 3 4<Directory "/"> Options +ExecCGI +FollowSymLinks +Includes +IncludesNOEXEC +Indexes -MultiViews +SymLinksIfOwnerMatch AllowOverride None </Directory>

  1. Change the AllowOverride line’s value from None to All.

Your server now allows CGI scripts to run in all directories.

Fix cPanel Error -The Email Account Already Exists

  1. Login to your Linux machine via SSH as root user.
  2. Navigate to the following path, locate and remove email account folder in question. /home/domainco/mail/domain.com
  3. Similarly, navigate to the following path, open passwd file with editor of your choice. Remove email account entry from that file and save it. /home/domainco/etc/domain.com
  4. Remove the email id from this file

How to add multiple ips in centos 7

In centos 7 by default ifconfig command will not work.
You need to install it using this command yum install net-tools
1.  Create a file in /opt/1.sh
2.  create ip list in an excel sheet,
Example:
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:1
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:2
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:3
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:4
3. Add ips in /opt/1.sh file
4. Execute sh 1.sh for the ips to display in ifconfig
5. For the ips to reflect in ifconfig even after server is rebooted add this command sh /opt/1.sh in /etc/rc.d/init.d/network file and it should be added above exit $rc

Ignore table and dump mysql database

-bash-4.1# mysqldump satmn13_drup189 > satmn13_drup1891.sql
mysqldump: Got error: 1146: Table ‘satmn13_drup189.dr_cache_admin_menu’ doesn’t exist when using LOCK TABLES

-bash-4.1# mysqldump satmn13_drup189 –ignore-table=satmn13_drup189.dr_cache_admin_menu > satmn13_drup1891.sql

Error: exim logged Undefined subroutine &main::user2uid called. LOG: MAIN

Exim error :
LOG: MAIN
cwd=/root 4 args: /usr/sbin/exim -i -v testemail@gmail.com
LOG: MAIN REJECT
F=<root@darkmatter.dnsprotect.com> rejected by non-SMTP ACL: failed to expand ACL string "${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}": Undefined subroutine &main::user2uid called. LOG: MAIN
cwd=/var/spool/exim 8 args: /usr/sbin/exim -v -t -oem -oi -f <> -E1UY3r2-000
root@server-web [~]# /scripts/buildeximconf
Configuration file passes test! New configuration file was installed.
/etc/exim.pl.local.build syntax OK
Enabled system filter options: attachments|spam_rewrite
..........
...
........
/etc/exim.pl.local installed!
razor2 is not installed, disabling it in SpamAssassin to save memory
pyzor is not installed, disabling it in SpamAssassin to save memory
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Refreshing SMTP Mail protection.
root@server-web [~]# cp -rpf /etc/exim.pl.local /etc/exim.pl

How-To disable IPv6 on RHEL6 / CentOS 6 / etc

Proper way of disabling IPv6 subsytem in RedHat Linux 6 / CentOS 6 (dont unload modules or so)

in /etc/sysctl.conf  :  net.ipv6.conf.all.disable_ipv6 = 1

in /etc/sysconfig/network  : NETWORKING_IPV6=no

in /etc/sysconfig/network-scripts/ifcfg-eth0 : IPV6INIT=”no”

disable iptables6 – chkconfig –level 345 ip6tables off

reboot

done

 

Without reboot it can be done using below command to disable IPV6

root@host121 [~]# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
root@host121 [~]# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

 

However on reboot will need to run same command again as it will revert back to original settings.