<< 在AppModule里配置Tapestry5支持UTF-8国际化和Servlet开发 | 首页 | 使用nekohtml完全控制并修整html >>

Ubuntu安装memcached的“C compiler cannot create executables”问题


安装memcached服务器:

One of the dependencies of memcache is libevent, so firstly download the source files for Libevent.


tar -xvf libevent-1.3b.tar.gz
cd libevent-1.3b
./configure;make;make install;

Download the latest Memcached source code from danga.com


gunzip memcached-1.2.1.tar.gz
tar -xvf memcached-1.2.1.tar
cd memcached-1.2.1
./configure;make;make install;

Often libevent.so cannot be found when executing memcache. A useful command LD_DEBUG, is very helpful to determine where libraries are being loaded from.


LD_DEBUG=help memcached -v
 
LD_DEBUG=libs memcached -v 2>&1 > /dev/null | less
18990: find library=libevent-1.3b.so.1 [0]; searching
...
18990: trying file=/usr/lib/libevent-1.3b.so.1
18990:
memcached: error while loading shared libraries: libevent-1.3b.so.1: cannot open shared object file: No such file or directory

Simply place the library where memcached will find it and execute memcached.


ln -s /usr/local/lib/libevent-1.3b.so.1 /lib/libevent-1.3b.so.1
memcached -d -u nobody -m 512 127.0.0.1 -p 11211
 

The options for memcached are:

-l <ip_addr>  
Listen on <ip_addr>; default to INDRR_ANY. This is an important option to consider as there is no other way to secure the installation. Binding to an internal or firewalled network interface is suggested.
-d
Run memcached as a daemon.
-u <username>
Assume the identity of <username> (only when run as root).
-m <num>
Use <num> MB memory max to use for object storage; the default is 64 megabytes.
-M
Instead of throwing items from the cache when max memory is reached, throw an error
-c <num>
Use <num> max simultaneous connections; the default is 1024.
-k
Lock down all paged memory. This is a somewhat dangerous option with large caches, so consult the README and memcached homepage for configuration suggestions.
-p <num>
Listen on port <num>, the default is port 11211.
-r
Maximize core file limit
-M
Disable automatic removal of items from the cache when out of memory. Additions will not be possible until adequate space is freed up.
-r
Raise the core file size limit to the maximum allowable.
-h
Show the version of memcached and a summary of options.
-v
Be verbose during the event loop; print out errors and warnings.
-vv
Be even more verbose; same as -v but also print client commands and responses.
-i
Print memcached and libevent licenses.
-P <filename>
Print pidfile to <filename>, only used under -d option.


Ubuntu 8.04桌面版下安装时报错:
C compiler cannot create executables /usr/bin/ld: crt1.o: No such file: No such file or directory

需要在连上互联网的情况下安装新的包然后再继续:

#
sudo apt-get update && sudo apt-get dist-upgrade

sudo apt-get install linux-libc-dev libc6-dev

sudo apt-get -f install linux-libc-dev libc6-dev libstdc++6-4.2-dev g++-4.2 g++ gcc

标签 : , , ,



发表评论 发送引用通报