linux下安装apache

安装前准备软件 apr-1.4.8.tar.gz apr-util-1.5.2.tar.gz   pcre-8.32.tar.gz   httpd-2.4.6.tar.gz 1、安装apr         1)shell# tar zxvf   apr-1.4.8.tar.gz         2) shell#  cd apr-1.4.8         3) shell#   ./configure –prefix=/usr/local/apr 错误解决: rm: cannot remove `libtoolT’: No such file or directory 解决办法: vi configure 在30031行 #    $RM “$cfgfile” 前面加#注释掉 在重新./configure         4) shell#  make && make install 2、安装apr-util         1) shell#  tar zxvf apr-util-1.5.2.tar.gz         2) shell#  cd apr-util-1.5.2         3)  shell#  ./configure –prefix=/usr/local/aprutil –with-apr=/usr/local/apr/  4) shell#  make && make install 4、安装pcre       1) shell#  tar zxvf pcre-8.32.tar.gz         2) shell#  cd pcre-8.32         3) shell#  ./configure –prefix=/usr/local/pcre         4) shell#  make && make install 5、安装apache 安装Apache有两个要注意的地方,因为我这里用的Postfix的后台管理是extman这个程序,而它是通过CGI的方式来进行管理的,所以这里启用了suexec的功能,还有一个是关于网站的存放路径的,如果不指定,那么在启用suexec后会出现 suexec-docroot的错误。       1) shell#  tar zxvf httpd-2.4.6.tar.gz       2) shell#  cd httpd-2.4.6       3) shell#  ./configure –prefix=/usr/local/apache2 –with-apr=/usr/local/apr –with-apr-util=/usr/local/aprutil –with-pcre=/usr/local/pcre –enable-so –enable-rewrite –enable-mods-shared=all –enable-suexec –with-suexec-caller=daemon –with-suexec-docroot=/var/www       4) shell#  make && make install       6) shell#  cd /usr/local/apache2/bin       7) shell#  ./apachectl start       #启动apache 启动apache报错 解决httpd: Could not reliably determine the server’s fully qualified domain name 进入apache的安装目录: linux : /usr/local/apache/conf 将里面的#ServerName localhost:80注释去掉即可。
6.安装完后的设置(对于php架设的网站要开通这两个功能) 1.apache开启伪静态 第一步:LoadModule rewrite_module modules/mod_rewrite.so   取消注释 第二步:搜索AllowOverride None 替换为 AllowOverride All(是有对应网站目录下的那个) 2.apache设置主页 修改apache的配置文件(/usr/local/apache/conf/httpd.conf)配置文件     DirectoryIndex index.php index.html 找到这段代码:按照顺序写你的主页,中间用空格隔开

至此,apache已安装完毕
文章知识点与官方知识档案匹配,可进一步学习相关知识CS入门技能树Linux入门初识Linux24904 人正在系统学习中

来源:linux凯

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2015年3月19日
下一篇 2015年3月19日

相关推荐