一般情况下rpm包对应文件的安装位置(以httpd为例,使用rpm –ql httpd查看文件的安装位置)
配置文件:/etc/httpd
程序所用函数库:/usr/lib64(或lib)/httpd
可执行文件:/usr/sbin/
使用手册:/usr/share/httpd
帮助文件:/usr/share/man
网页文件存放:/var/www/html
RPM包服务启动方法(存疑,因为我的httpd服务没办法这样启动)
/etc/rc.d/inid.d/httpd start
service httpd start
源码包安装位置:
/usr/local/src
源代码安装位置:
/usr/local/
源码包的服务启动
/usr/local/apache2/bin/apachectl start
1. 下载源码包,解压缩
tar –zxvf <File name>
2. 进入解压缩目录
3. ./configure 软件配置与检查
定义软件安装位置,其中/usr/local/是系统默认准备的安装位置
./configure –prefix=/usr/local/apache2
报错:当我到这一步时,系统报错:
PCRE is required and available from http://pcre.org/
于是,我到对应的网址,下载PCRE对应的安装包,以同样的方式进行安装。
然后,当我再次进入httpd目录,执行以上操作时,依然报错:
configure:error:pcre-config for libpcre not found. PCRE is required andavailable from http://pcre.org/
原来,我的PCRE安装目录名为/usr/local/pcre-7.8
所以,我在httpd的目录中,实际执行命令为:
./configure--prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre-7.8
4. 编译
make
5. 编译执行(取消)
make install
make clean
6. 启动apchae
/usr/local/apache2/bin/apachectl start
7. 源码包卸载
rm –rf删除对应目录即可