安装Apache-php项目运行的lamp环境搭建
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">lamp = linux + apache + mysql + php</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">首要</span>来讲一下搭建Apache的过程。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Apache编译安装之前,需要先安装依赖apr, apr-util。安装apr-util之前需要先安装apr。 <span style="color: black;">这儿</span>说明一下,软件的安装路径</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/5e1b8b1a0bd64abebd03201ec60ccfc7~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1728209391&x-signature=uBXaC8yZH2WvdF193rBqBE58HA4%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">准备安装之前的环境</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">经过</span>yum安装<span style="color: black;">有些</span>依赖的库,及软件</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>yum install -y epel-release</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>yum install -y gcc wget make libtool expat-devel pcre-devel openssl-devel libxml2-devel </p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装apr</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.7.0.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>tar -zxvf apr-1.7.0.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>cd apr-1.7.0</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>./configure --prefix=/usr/local/apr</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>make</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>make install </p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装apr-util</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>tar -zxvf apr-util-1.6.1.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>cd apr-util-1.6.1</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>make</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>make install </p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">安装Apache</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>wget http://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.39.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>tar -zxvf httpd-2.4.39.tar.gz</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>cd httpd-2.4.39</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>./configure --prefix=/usr/local/apache \--with-apr=/usr/local/apr \--with-apr-util=/usr/local/apr-util \--enable-so \--enable-ssl \--enable-cgi \--enable-rewrite \--with-pcre \--with-zlib \--with-mpm=event \--enable-modules=most \--enable-mpms-shareds=all$ make$ make install</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">验证<span style="color: black;">是不是</span>安装成功</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">起步</span>Apache</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>cd /usr/local/apache</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">>>>./bin/httpd -k start </p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Apache成功<span style="color: black;">起步</span>之后,运行netstat -tunlp | grep httpd是能够看到<span style="color: black;">处在</span>监听状态的httpd进程. <span style="color: black;">或</span><span style="color: black;">经过</span>浏览器<span style="color: black;">拜访</span><span style="color: black;">http://your_ip</span>, 能够得到一个Apache返回的页面</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">重视</span>:安装成功之后,可能会<span style="color: black;">拜访</span>不了,此时需要关闭防火墙。</p>
顶楼主,说得太好了! 软文发布论坛开幕式圆满成功。 http://www.fok120.com 你的见解真是独到,让我受益匪浅。
页:
[1]