您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

ubuntu下使用源代码编译安装apache2.2.26

2024/8/25 8:33:00发布39次查看
下载httpd-2.2.26.tar.gz(下载地址),执行
sudo tar xzfv httpd-2.2.26.tar.gz cd httpd-2.2.26 sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so
如果提示如下错误:
checking for c compiler default output file name... configure: error: c compiler cannot create executables
原因是未安装libc6-dev ,执行
sudo apt-get install build-essential
就ok了。
然后重新执行:
sudo ./configure --prefix=/usr/local/apache2 --enable-module=most --enable-rewrite --enable-shared=max --enable-so
未报错,接着执行
sudo make sudo make install sudo groupadd apache sudo useradd -g apache apache sudo passwd apache sudo chown -r apache:apache /usr/local/apache2
修改apache的配置文件,执行
sudo vi /usr/local/apache2/conf/httpd.conf
找到
user nobody group #-1
修改成
user apache group apache
找到
#servername www.example.com:80
改为
servername *:80
保存!
执行命令
sudo /usr/local/apache2/bin/apachectl start
启动apache.
打开浏览器,访问http://localhost
如果一切顺利,应该可以看到apache的测试页面。恭喜你,apache安装好了!
重启和关闭apache服务的命令分别是:
sudo /usr/local/apache2/bin/apachectl restart sudo /usr/local/apache2/bin/apachectl stop
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product