WordPress Import Failure Blank Screen

When trying to import a WordPress XML dump from another instance, after submitting the upload it returned a blank screen containing only “Import WordPress”.

A quick check of the php logs showed the entry:

PHP Fatal error: Class ‘DOMDocument’ not found in /home/xxxxxx/wp-content/plugins/wordpress-importer/parsers.php on line 61

You just need to install the php-xml module.

yum install php-xml

service restart httpd

Refresh your browser and try it again. Should be all good.

redhat

How To View Log File In Linux

Log files play a vital role in troubleshooting. Knowing where they’re stored and how to read them is pertinent information. I came from a Windows background. Microsoft made it pretty easy. Linux uses a different set of rules.

Login as root user using SSH

Navigate to /var/logs directory
# cd /var/logs

To list files use the following command
# ls

To view a common log file called /var/log/messages use any one of the following command:

# less /var/log/messages
# more -f /var/log/messages
# cat /var/log/messages
# tail -f /var/log/messages
# grep -i error /var/log/messages

You don’t have to use all of those commands. I do recommend trying them all, however, just to see the different types of output available.

redhat

How To Change MTU Size In CentOS and Linux

I ran into an issue with LDAP replication failing for some our remote sites in South Africa. After some troubleshooting, it looks like the local ISP is restricting MTU. In order to resolve the dropped packet issues and make LDAP replication possible, we had to change the MTU on our local servers sending the packets.

This has to be done at the source, not just at the router/firewall. I’ve read that it’s best if they do match however. For instance, if you set the MTU to 1300 on the ethernet port, set the MTU to 1300 on the firewall. If you set the MTU at the firewall to 1300 and not the source, packet loss will still occur.

I did some basic troubleshooting to find the issue using a ping variation:
ping mydomain.com -f -l 1472

Pinging mydomain.com [172.16.61.1] with 1472 bytes of data:

Reply from 10.0.10.1:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for 172.16.61.1:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

 

Solution: Permanently change MTU size on VM (my ping test gave me good results with 1300)

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Output:
DEVICE=eth0
TYPE=Ethernet
UUID=76a8c659-2a7e-459f-abf2-e81230a2ece5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
#HWADDR=06:74:8A:00:17:D9 # Commented by Clonezilla
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″

add a setting
MTU=”1300″

Esc
:wq!

Restart network service
service network restart

Verify change took
vi /etc/sysconfig/network-scripts/ifcfg-eth0

Output:
DEVICE=eth0
TYPE=Ethernet
UUID=76a8c659-2a7e-459f-abf2-e81230a2ece5
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
#HWADDR=06:74:8A:00:17:D9 # Commented by Clonezilla
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
MTU=”1300″
IPV6INIT=no
NAME=”System eth0″

After trying ping again, I received a good ping

 

 

After re-initializing my LDAP replication, it started and completed with no problem.

Using chattr CMD To Protect Documents

The form of the chattr command is:

chattr [-RVf] [-+=AacDdijsSu] [-v version] files…
-R is to recurse all subdirectories
+i is to set the immutable bit to prevent even root from erasing or changing the contents of a file.
-i is to unset the immutable bit
The form of the chflags command is:

chflags [-R [-H | -L | -P] flags file …
-H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.)
-L If the -R option is specified, all symbolic links are followed.
-P If the -R option is specified, no symbolic links are followed. This is the default.
-R Change the file flags for the file hierarchies rooted in the files instead of just the files themselves.
Attributes (chattr)[edit]
Some attributes include:

append only (a)
don’t update atime (A)
compressed (c)
no Copy-on-write (C) [2]
no dump (d)
synchronous directory updates (D)
immutable (i)
data journaling (j)
secure deletion (s)
synchronous updates (S)
no tail-merging (t)
top of directory hierarchy (T)
undeletable (u)

I’m using it to keep the /etc/resolv.conf file from changing after a restart
chattr +i /etc/resolv.conf

To enable changes, run
chattr -i /etc/resolv.conf