Make sure you have APR and APR-Util already installed(安装) on your system. If you don’t, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution(分布) must be under /httpd_source_tree_root/srclib/apr/) and use ./configure’s –with-included-apr option. On some platforms, you may have to install the corresponding -dev packages to allow httpd to build against your installed copy of APR and APR-Util.
wget http://apache.fayea.com//apr/apr-1.5.2.tar.gz
wget http://apache.fayea.com//apr/apr-util-1.5.4.tar.gz
上面说的很清楚 放置在apr-util 目录下和apr
下载完了,然后解压移动到目录
5. ./configure –prefix=/usr/local/apache2 再来试试,发现成功了诶
紧接着 make install …
6. 启动试试 /usr/local/apache2/bin/apachectl start
7. 在Linux下用源代码方式编译安装完Apache后,启动关闭Apache可以通过如下命令实现:
/usr/local/apache2/bin/apachectl start | stop | restart
如果想将httpd列入系统自动启动的服务,可以直接将上述的apachectl文件拷贝到 /etc/init.d/中 ,就像mysql 一样
http://blog.sina.com.cn/s/blog_6739945f0100zgpb.html
http://www.voidcn.com/article/p-ymultsej-od.html
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
chkconfig -add httpd
这些是系统启动的级别
我们就可以通过service命令来启动关闭apache了。在任意路径下执行:service httpd start | stop | restart
chkconfig在命令行操作时会经常用到,它可以方便地设置和查询不同运行级上的系统服务chkconfig 语法:
chkconfig [–add] [–del] [–list] [系统服务]
chkconfig [–level/levels] [等级代号] [系统服务] [on/off/reset]
等级代码为:linux系统的运行级别。linux 将操作 环境分为以下7个等级,即
0:关机
1:单用户模式(单用户、无网络)
2:无网络支持的多用户模式(多用户、无网络)
3:有网络支持的多用户模式(多用户、有网络)
4:保留,未使用
5:有网络支持有X-Window支持的多用户模式(多用户、有网络、X-Window界面)
6:重新引导系统,即重启
先用chkconfig list查询apache和mysql服务是否存在,不存在则需要手动添加。
添加apache服务项命令:
chkconfig -add httpd
添加完设置启动项:
chkconfig –level 2345 httpd on
chkconfig –level 2345 mysqld on
http://www.cnblogs.com/Anker/p/3551508.html
8. 看看apache的目录和windows的差不多啊
9. 支持Php
http://jingyan.baidu.com/article/d2b1d10299bda55c7f37d466.html
http://www.bkjia.com/Linuxjc/1096474.html
http://www.cnblogs.com/roronoa-sqd/p/5469687.html
之前我在使用安装php7的时候没有指定参数,所以在modules下面没有产生支持php的可执行文件,所以重新安装一次。
./configure
–prefix=/usr/local/php/
–with-apxs2=/usr/local/apache2/bin/apxs