ubuntu下安装apache常见错误
本文也参考了http://blog.csdn.net/lilian129/article/details/45509797这篇转发的微博!原链接没走找到,在此表示歉意!
本文环境Ubuntu 16.04 Apache2.4.25
今天想在自己的电脑上将Apache 搭建起来,在编译./configure 这个步骤遇到了一些问题,在此记录,供后来遇到的借鉴。
参考官方文档http://httpd.apache.org/docs/2.4/install.html
Make sure you have APR and APR-Util already installed on your system,确保安装APR and APR-Util
我由于没有看,所以就遇到了编译时走的检查APR 和APR-Util时就报错了
然后在Apache上下载了apr-1.5.2.tar.gz 和apr-util-1.5.4.tar.gz
然后三部曲
$ ./configure --prefix=PREFIX
$ make
$sudo make install
之后又遇到 checking for pcre-config... false
然后在提示下我安装了pcre-8.38,结果还是不行,
百度到了 :
还要装个pcre 和pcre-devel 这个在Stack Overflow上找到一个方法如下
Try using apt-cache search, e.g.,
sudo apt-cache search pcre
For me this turns up a lot so I grep for the keyword dev.
This turns up ‘libpcre3-dev' and 'libpcre++-dev'.
'lighttpd' will use one of those no doubt.
Any reason you're compiling lighttpd yourself?
Why not install using apt-get?
Including lighttpd-dev, lighttpd-doc and some related modules.
还要安装3个东西libpcre3-dev、libpcre++-dev、lighttpd
但是我没有验证Lighttpd是否要装,只是顺手就安装上了,然后在编译,命令如下
./configure --prefix=/usr/local/apache24
--with-apr-util=/usr/local/apr-util
--with-pcre
通过!!!!!!!测试一下看看
john@UBT:/usr/local/apache24/bin$ ./apachectl -k start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open log
这里没权限,应该sudo,其次:using 127.0.1.1. Set the 'ServerName' directive
用sudo后系统可以正确启动,浏览器里输入127.0.1.1,就显示“It works!”
到此apache安装完
下一步安装mod_wsgi
待续

浙公网安备 33010602011771号