1、apache 配置、編譯、安裝完畢后,啟動apache :apachectl start,報錯如下:
httpd: Syntax error on line 140 of /usr/local/apache2/conf/httpd.conf: Cannot load
/usr/local/apache2/modules/mod_dir.so into server: /usr/local/apache2/modules/mod_dir.so: undefined symbol: apr_array_clear
解決辦法:
重新配置、編譯與安裝apache,在configure的時候,帶上選項:--with-included-apr。
重新配置、編譯與安裝的步驟如下:
.cd httpd.2.4.6
.make clean
./configure --prefix=/usr/local/apache --enable-so –enable-mods-shared=most --with-mpm=worker --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-included-apr
.make
.make install
2、啟動apache遇到錯誤:httpd: Could not reliably determine the server's fully qualified domain name,具體為:
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
問題原因與解決辦法:這一般是由于本機DNS設置錯誤或不想連接外網,所以故意不設置導致成的。解決辦法如下:
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
注意,端口號要與實際啟動的端口號,即Listen配置相同。若啟動了多個Listen實例,則需要對應的配置多個ServerName與之相對應,否則還會報錯。
參考鏈接:
http://www.2cto.com/os/201201/117797.html
http://hi.baidu.com/zeldady/item/96f1ae30742006c31a969631
3、源碼編譯apache報錯:
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
解決辦法:
將APR和APR-util源碼下載,解壓放到httpd-2.4.3/srclib里面,并去除版本號
cp -r apr-1.4.6 httpd-2.4.3/srclib/apr
cp -r apr-util-1.4.1 httpd-2.4.3/srclib/apr-util
參考:http://blog.sina.com.cn/s/blog_a45d5a3a01016ycc.html