The server of Apache (一)——apache服务的基本安装过程
2016-10-10 18:37
615 查看
一、为了避免端口冲突,需要卸载linux系统中以RPM方式安装的httpd
~] # rpm -qa | grep httpd~] # rpm -e httpd --nodeps (此处nodeps为忽略依赖关系)
二、将下载获得的httpd源码包解压后释放到 /usr/src/ 目录下
~] # tar zxvf httpd-2.2.17.tar.gz -C /usr/src~] # cd /usr/src/httpd-2.2.17
三、配置:定制编译选项
~] # ./configure --prefix=/usr/local/httpd (指定安装路径)--enable-so (启动动态加载模块支持:功能模块启用时不需关闭服务器即可实现)
--enable-rewrite (启用网页地址重写功能:上传网页不需要关闭服务)
--enable-charset-lite (启用字符集支持)
--enable-cgi (启用cgi脚本程序支持)
四、编译及安装
~] # make && make install (其中&&符号释义为:make成功后才会继续执行下面的make install命令;make命令需要有gcc和gcc++编译环境的支持,可用yum工具安装,或者linux装机时选择“开发工具”选项。)五、确认安装结果
~] # ls /usr/local/httpd简要列举/usr/local/httpd文件夹下的主要内容:
/bin : 存放httpd服务的可执行程序文件、命令等、
/conf : 配置文件httpd.conf的目录
/htdocs : 网页文件的默认存放路径
/logs : 日志文件目录
/modules : 存放httpd服务的模块文件夹
/cgi-bin : 存放各种cgi程序文件
六、优化执行路径
通过源码编译安装的httpd服务,程序路径并不在默认的搜索路径中,为了使该服务在使用时更加方便,可以为相关程序添加链接~] # ln -s /usr/local/httpd/bin/* /usr/local/bin
此时我们可直接运行
~] # apachectl -v 命令查看apache服务的版本了
七、添加httpd为系统服务
~] # cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd~] # vim /etc/init.d/httpd
修改前三行
# !/bin/bash
# chkconfig: 35 85 21 (3和5运行级别开启服务“-”为不开启,第85个被开启,第21个被关闭)
# description: ————参数描述行————
(注意:一般配置文件以#开头表示注释掉此行信息,但apache服务前三行必须加#,同时生效;其中#号后面和内容要有空格,35前面也要有空格)
~] # chkconfig --add httpd (开启重启加载)
~] # chkconfig --list httpd(检查是否生效)
相关文章推荐
- The server of Apache (二)——apache服务客户端验证
- CentOS 5.2,Linux 2.6+ 内核 ,Apache+MySQL+PHP 安装及基本配置过程记录 && 将apache安装为系统服务
- ESRI 安装过程中“The computer you chose is not a valid license server”
- Ubuntu Server系列各项服务的安装和维护 Apache安全
- Apache http server linux 安装过程说明
- 兔子--安装或者卸载mysql服务出现Install/Remove of the Service Denied!错误
- Linux下安装apache http server 过程
- Ubuntu Server系列各项服务的安装和维护 Apache部分
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- rhel5.4 x64安装apache http server2.2.27,并创建自动启服务
- Install/Remove of the Service Denied! (mysql服务的安装问题)
- 安装mysql服务出现Install/Remove of the Service Denied!错误
- Apache:Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
- LAMP系列之-Apache服务生产实战应用指南之安装后基本配置编译版
- the Serverless design of embedded database system(嵌入式数据库的无服务设计的概念)
- Linux Server 5.5安装SVN+Apache服务[转]
- 安装mysql服务出现Install/Remove of the Service Denied!错误
- Apache+php服务的源码安装和配置过程记录
- 安装mysql服务出现Install/Remove of the Service Denied!错误
- iOS 如何在苹果电脑上安装svn 服务器(how to install svn server on the computer of mac os x)