/opt/lua/lib/liblua.a: could not read symbols: Bad value

I got the following error while installing modsecurity from source file.

/opt/lua/lib/liblua.a: could not read symbols: Bad value

Fix : Install the following packages.

yum install lua lua-devel libsmi-devel.x86_64

Advertisements

Linux swap space

Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache.

However, swapping does have a downside. Compared to memory, disks are very slow. Memory speeds can be measured in nanoseconds, while disks are measured in milliseconds, so accessing the disk can be tens of thousands times slower than accessing physical memory. The more swapping that occurs, the slower your system will be. Sometimes excessive swapping or thrashing occurs where a page is swapped out and then very soon swapped in and then swapped out again and so on. In such situations the system is struggling to find free memory and keep applications running at the same time. In this case only adding more RAM will help.

Linux has two forms of swap space: the swap partition and the swap file. The swap partition is an independent section of the hard disk used solely for swapping; no other files can reside there. The swap file is a special file in the filesystem that resides amongst your system and data files.

 

Reference : https://www.linux.com/news/all-about-linux-swap-space

Check Memory Usage in Linux

1, Free command –> The most effective tool for finding the memory usage and other details. The m option displays all data in MBs.

free -m
total used free shared buffers cached
Mem: 22528 14872 7655 1048 0 13497
-/+ buffers/cache: 1374 21153
Swap: 4096 1461 2634

2,/proc/meminfo –> Another way is to read the /proc/meminfo file. The important values can be find from this. Please check sample result.

cat /proc/meminfo
MemTotal: 23068672 kB
MemFree: 7839488 kB
Cached: 13890932 kB
SwapTotal: 4194304 kB
SwapFree: 2697752 kB
Shmem: 1143948 kB

3,vmstat –> The vmstat command with the s option, lays out the memory usage statistics much like the proc command.

vmstat -s
23068672 total memory
15195280 used memory
7472596 active memory
7478680 inactive memory
7873392 free memory
0 buffer memory
13855964 swap cache
4194304 total swap
1496552 used swap
2697752 free swap

4, Top command and htop command will also give all the information. The result from top command is given below.

Mem: 23068672k total, 15279760k used, 7788912k free, 0k buffers
Swap: 4194304k total, 1496184k used, 2698120k free, 13857660k cached

5, Ram information –> To find out hardware information about the installed RAM, use the demidecode command. It reports lots of information about the installed RAM memory.

dmidecode -t 17

Better understanding of linux free memory

Usually we all have confusion regarding the amount of free memory available while running the command free -m. In the following example

free -m
total used free shared buffers cached
Mem: 72348 71972 375 0 6242 41377
-/+ buffers/cache: 24352 47995
Swap: 4095 1309 2786

In the above result, from the top line we can see that out of 72GB available 71GB is being used, but we don’t see any such high memory usage in the server. But you can see lot of memory in cached. The actual memory is being used is in the disk cache. Cached memory is essentially free, so that it can be quickly taken if a running (or newly starting) program needs the memory.

The reason Linux uses so much memory for disk cache is because the RAM is wasted if it isn’t used. Keeping the cache means that if something needs the same data again, there’s a good chance it will still be in the cache in memory. Fetching the information from there is around 1,000 times quicker than getting it from the hard disk. If it’s not found in the cache, the hard disk needs to be read anyway.

The -/+ buffers/cache line shows how much memory is used and free from the perspective of the application.

The difference between buffers and cache –> Buffers are associated with a specific block device, and cover caching of filesystem metadata as well as tracking in-flight pages. The cache only contains parked file data.
That is, the buffers remember what’s in directories, what file permissions are, and keep track of what memory is being written from or read to for a particular block device. The cache only contains the contents of the files themselves.

Deprecated: Assigning the return value of new by reference is deprecated

I have received the following error message on my website

Deprecated: Assigning the return value of new by reference is deprecated

The reason is that my host has upgraded php version in the server and the function I have used in my site has been depreciated.

You can fix this by simply doing some edits. if you go to the files and the line numbers indicated in the error messages, you’ll see something like this:
$object =& new MyObject();

You can just remove the “&” from the above line

Base_url_change in majento

1, Via mysql command line
————————–
Select the database
Mysql>> use database;

Now run the following command to list the current base url
Mysql>> select * from core_config_data where path like ‘%base%url%’;

To change the base URLs, execute the following commands from mysql prompt
update core_config_data set value = ‘http://domainname/’ where path = ‘web/unsecure/base_url’;
update core_config_data set value = ‘http://domainname/’ where path = ‘web/secure/base_url’;

2, Via phpmyadmin
—————-
Take PhpMyAdmin and select the required database. Now you will see a list of all the tables in the database in alphabetical order. Search for the table.

Expand the viewing area of phpMyAdmin. At the top and bottom in the main panel, locate the grey box and change the Number of rows to a larger number, such as 100.

Locate the rows web/unsecure/base_url and web/secure/base_url and click Edit next to the corresponding lines. Change the base URL to the intended string, and click OK.

Flush the Magento cache, and the site should load with the set base URLs properly now.

3, Magento Admin Panel.
————-

From majento admin panel click System > Configuration.

From the menu on the left, under the General list>> web

Open the Unsecure and Secure dropdowns, locate the base URL line, and replace this with the new URL.

Clear the Magento cache and your browser’s cache. The site should now load properly.