首页 运维 网络学院 查看内容

Ubuntu下安装Apache

2011-5-5 10:52 789 0

摘要:   本安装方式是在Ubuntu下采用tar包源码得方式安装。  去官方下载apache2.2.17 源码包:http://www.apache.org/dist/httpd/httpd-2.2.17....
关键词: apache httpd sudo server 2.2 http tar 中加 127.0 ServerName

  本安装方式是在Ubuntu下采用tar包源码得方式安装。  去官方下载apache2.2.17 源码包:http://www.apache.org/dist/httpd/httpd-2.2.17.tar.gz  1.解压缩httpd-2.2.17.tar.gz 到临时目录如~/httpd-2.2.17  sudo tar zxvf httpd-2.2.17.tar.gz  ~/http-2.2.17  2.进入~/apache目录,执行  sudo ./configure --prefix=/usr/server/apache2 --enable-module=so  sudo make  sudo make install  实际执行过程中可能要求你有root权限,所以要求使用sudo  3.启动和停止apache  启动:sudo /usr/server/apache2/bin/httpd -k start  启动时提示:  httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.  解决办法是在http.conf中加一行:  ServerName 127.0.0.1:80  否则,只能在本地用127.0.0.1访问,不能使别的电脑访问网站  停止:sudo /usr/server/apache2/bin/httpd -k stop  4.让Ubuntu开机自动启动apache.  1). 复制 /usr/server/apache2/bin/apachectl到/etc/init.d  2). 加载为服务  sudo update-rc.d apachectl defaults  开机重启访问http://localhost/如果显示apache的网页,就说明自动启动成功了。
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部