-----------------------------------------------------------------实践整理来自网络-----------------------------------------------------------------------------------
1. 先学习:什么是web服务器?它有什么用?
https://zhidao.baidu.com/question/264775593.html
2.动手实战:
(1)先在windows下载thttpd,下载地址是:http://www.acme.com/software/thttpd/
(2) 上传 thttpd-2.27.tar.gz 到samba服务器的共享目录(/share),先说说:移植都有一个一个相似的套数:解压-->配置-->编译-->安装
(3) # tar xvf thttpd-2.27.tar.gz
# cd thttpd-2.27
# ./configure (主要为了生成Makefile)
# make
# make install
(4) 出现这样的错误:
cp makeweb /usr/local/sbin/makeweb
chgrp www /usr/local/sbin/makeweb
chgrp: invalid group: ‘www’
Makefile:70: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/share/thttpd-2.27/extras'
Makefile:121: recipe for target 'installsubdirs' failed
make: *** [installsubdirs] Error 2
(5)解决办法:忽略上面的错误,网络上查到是因为Makefile某个命令或语句后面多了一个空格导致,这个问题比较难找,当然还有一种说法是给在执行make install 给它传入“-i”去忽略这些错误。
(6) cd /etc 。然后创建配置文件:vi thttpd.conf 并添加下面的内容:
dir=/usr/local/www #web服务器存放网页的根目录
user=root #登陆用户
logfile=/var/log/thttpd.log #日志文件
pidfile=/var/run/thttpd.pid #进程临时文件
port=8080 #端口号
cgipat=/cgi-bin/* #cgi程序目录,注意是以dir目录为开始的根目录
(7) 重启webserver服务器:sudo thttpd -C /etc/thttpd.conf
(8) 测试:在浏览器输入:http://本地IP:8080(Ubuntu 本地IP)
........
..........
--------------------------------------------------------------------测试失败,后续-----------------------------------------------------------------------------------------------