web服务器熟悉(apache编译)

1.
cmd->telnet
open www.baidu.com
GET /index.html HTTP/1.1
Host: www.baidu.com
回车

cmd->telnet
open www.baidu.com
HEAD /index.html HTTP/1.1
Host: www.baidu.com
回车

2.详细解释
http://www.blogjava.net/zjusuyong/articles/304788.html

 

 

一.ubuntu下载apache(熟悉大概环境)
1.安装
sudo apt-get install apache2
2.配置
/var/www/html //默认网站目录,浏览器打开127.0.0.1
/etc/apache2/apache2.conf //配置文件
3.启动
/etc/init.d/apache2 restart //重启


二.unbutu下源码编译安装apache
1.安装apache需先卸载
service apache2 stop
sudo apt-get --purge remove apache2
sudo apt-get --purge remove apache2.2-common
sudo apt-get autoremove

sudo find /etc -name "*apache*" -exec rm -rf{} \;
sudo rm -rf /var/www

2.下载apache2.2.31源码,2.4版本无apr,apr-util源码包
sudo apt-get install axel
axel http://mirrors.hust.edu.cn/apache/httpd/httpd-2.2.31.tar.gz
//下载完后
//解压
tar zxvf httpd-2.2.31.tar.gz
cd httpd-2.2.31
//apr
cd apr
./configure --prefix=/usr/local/apr
make
make install
//apr-util
cd ../apr-util
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
//pcre
apt-get install libpcre2-dev

3.编译
cd ../apache
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr
--with-apr-util=/usr/local/apr-util --enable-so --enable-dav
--enable-mainer-mode --enable-rewrite
make
make install

4.启动
/usr/local/apache/bin/apachectl start
//报错不能发现apr/conf/httpd.conf
//mkdir ../apr/conf
//cp conf/httpd.conf ../apr/conf/httpd.conf
//修改httpd.conf,ServerRoot "/usr/local/apache"的下方
//添加行ServerName localhost

5.其它错误
make错误:make clean后重新./configure...
apachectl start错误:是否安装过没卸载干净


三.thttpd安装编译
http://blog.csdn.net/21aspnet/article/details/7045845

posted @ 2015-12-01 18:42  迷城有你  阅读(196)  评论(0)    收藏  举报