ubuntu16.04 linux 编译安装apache2.4.33的教程详解
下载软件包:
wgethttp://mirror.bit.edu.cn/apache//httpd/httpd-2.4.33.tar.gz wgethttp://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz wgethttp://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
首先需要安装apr和apr-util
tarxfapr-1.6.3.tar.gz cdapr-1.6.3/ ./configure sudomake sudomakeinstall
安装apr-util:
./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr sudomake sudomakeinstall
这两个必不可少,如果缺少其他的依赖,请自行百度
安装apr-util的,在编译的时候报错:
xml/apr_xml.c:35:19:fatalerror:expat.h:Nosuchfileordirectory
解决方法:
sudoapt-getinstalllibexpat1-dev
还有其他依赖:
1,pcre
sudoapt-getinstalllibpcre3libpcre3-dev
2,openssl
sudoapt-getinstallopenssllibssl-dev
3,zlib
sudoapt-getinstallzlib1g-dev
编译apache
./configure\ --prefix=/usr/local/httpd24\ --sysconfdir=/etc/httpd24\ --enable-so\ --enable-ssl\ --enable-cgi\ --enable-rewrite\ --with-zlib\ --with-pcre\ --with-mpm=prefork\ --enable-modules=most\ --enable-mpms-shared=all
最后makemakeinstall
root@dev:~#/usr/local/httpd24/bin/apachectlstart root@dev:~#ps-ef|grephttpd root2441117534006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart daemon2441224411006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart daemon2441324411006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart daemon2441424411006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart daemon2441524411006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart daemon2441624411006:15?00:00:00/usr/local/httpd24/bin/httpd-kstart root2441824367006:15pts/1900:00:00grep--color=autohttpd
修改配置文件(vim/etc/httpd24/httpd.conf)
ServerName127.0.0.1
DocumentRoot后面指定一个网站根目录
总结
以上所述是小编给大家介绍的ubuntu16.04linux编译安装apache2.4.33的教程详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!