ubuntu11.10平台g++/apache2等配置

Ubuntu安装g++sudo apt-get install make gcc g++
再装上函数手册
sudo apt-get install manpages-dev
或者采用
sudo apt-get install build-essential
Ubuntu下安装Apache
# 编译和安装 apr 1.2
cd srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install
# 编译和安装 apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install
# 配置 httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/
Prce-8.00 安装问题
[root@hyousoft pcre-8.00]# make ----------------------第一次make报错
make all-am
make[1]: Entering directory `/usr/app/pcre-8.00'
source='pcrecpp.cc' object='pcrecpp.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ./depcomp \
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -c -o pcrecpp.lo pcrecpp.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcrecpp.cc -o .libs/pcrecpp.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcrecpp.cc >/dev/null 2>&1
source='pcre_scanner.cc' object='pcre_scanner.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ./depcomp \
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -c -o pcre_scanner.lo pcre_scanner.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcre_scanner.cc -o .libs/pcre_scanner.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcre_scanner.cc >/dev/null 2>&1
source='pcre_stringpiece.cc' object='pcre_stringpiece.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/sh ./depcomp \
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -c -o pcre_stringpiece.lo pcre_stringpiece.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcre_stringpiece.cc -o .libs/pcre_stringpiece.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -c pcre_stringpiece.cc >/dev/null 2>&1
/bin/sh ./libtool --tag=CXX --mode=link g++ -version-info 0:0:0 -o libpcrecpp.la -rpath /usr/local/lib pcrecpp.lo pcre_scanner.lo pcre_stringpiece.lo libpcre.la
libtool: link: unsupported hardcode properties
libtool: link: See the libtool documentation for more information.
libtool: link: Fatal configurationerror.
make[1]: *** [libpcrecpp.la] 错误 1
make[1]: Leaving directory `/usr/app/pcre-8.00'
make: *** [all] 错误 2
解决办法: 再一次: ./configure 之后执行:make
------------------------------------------------------------------------第二次报错
/bin/sh ./libtool --tag=CXX --mode=link g++ -O2 -version-info 0:0:0 -o libpcrecpp.la -rpath /usr/local/lib pcrecpp.lo pcre_scanner.lo pcre_stringpiece.lo libpcre.la
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.4/crtbeginS.o .libs/pcrecpp.o .libs/pcre_scanner.o .libs/pcre_stringpiece.o -Wl,-rpath -Wl,/usr/app/pcre-8.00/.libs -Wl,-rpath -Wl,/usr/local/lib ./.libs/libpcre.so -L/usr/lib/gcc/x86_64-redhat-linux/4.4.4 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.4.4/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crtn.o -Wl,-soname -Wl,libpcrecpp.so.0 -o .libs/libpcrecpp.so.0.0.0
/usr/bin/ld: .libs/pcrecpp.o: relocation R_X86_64_32S against `.bss'can not be used when making a shared object; recompile with -fPIC
.libs/pcrecpp.o:could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libpcrecpp.la] 错误 1
make[1]: Leaving directory `/usr/app/pcre-8.00'
make: *** [all] 错误 2
解决办法:./configure --disable-shared --with-pic 之后执行:make 没有错误
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
解决办法非常简单:
#vim /web/apache/conf/httpd.conf (在这里/web/apahce是我安装apache的目录,你默认安装的话应该是/usr/local/apache2/icons)
找到#ServerName www.example.com:80 把#去掉,再重启apache即可没事了。
现象:
bogon:~/webserver/httpd-2.0.59 # /usr/local/apache2/bin/apachectl start
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd (pid 20183) already running
這個問題應該是沒有在 /etc/httpd/conf/httpd.conf 中設定 ServerName
vi /usr/local/apache2/conf/httpd.conf
最简单的,修改httpd.conf文件,增加:
ServerName www.example.com:80
我的改为:
ServerName www.example.com:80
Tags: 

延伸阅读

最新评论

发表评论