Linux搭建WEB服务器

2025-04-12 08:39:00

1、1.安装Apache(1)在安装HTTPServer之前需安装APR(ApachePortableRuntime)和APR-util安装APR(http://apr.apache.org/)$tarzxvfapr-1.4.6.tar.gz$cdapr-1.4.6/$./configure$make$sudomakeinstall

2、(2)安装APR-util(http://apr.apache.org/)$tarzxvfapr-util-1.4.1.tar.gz$cdapr-util-1.4.1$./configure–with-apr=/usr/local/apr(whereisapr)$make$sudomakeinstall

3、(3)安装httpd-2.4.2.tar.bz2(http://httpd.apache.org/)默认安装位置/usr/local/apache2网页放在/usr/local/apache2/htdocs配置文件/usr/local/apache2/conf/httpd.conf$tarjxvfhttpd-2.4.2.tar.bz2$cdhttpd-2.4.2/$./configure$make$sudomakeinstall

4、(4)启动HTTPServer$sudo/usr/local/apache2/bin/apachectlstartAH00558:httpd:Couldnotreliablydeterminetheserver’sfullyqualifieddomainname,using127.0.1.1.Setthe‘ServerName’directivegloballytosuppressthismessage

5、(5)查看http是否正常运行$netstat-a|grephttptcp00*:http*:*LISTEN

6、(6)在浏览器输入127.0.0.1如果正常应该显示“Itworks!”

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢