源代码编译安装apache

准备apache源包,放入liunx /root界面下

[root@localhost ~]# tar -xf httpd-2.2.17.tar.gz -C /usr/src/ 解压apache源包

[root@localhost ~]# cd /usr/src/httpd-2.2.17/ 进入源包

[root@localhost httpd-2.2.17]# ./configure --prefix=/usr/local/apache 运行源包,安装

[root@localhost httpd-2.2.17]# make 编译

[root@localhost httpd-2.2.17]# make install 编译后安装

可以用&&把三条命令连接,上一条命令成功,会执行下一条命令,节省时间

[root@localhost httpd-2.2.17]# ./configure --prefix=/usr/local/apache && make && make install 

[root@localhost httpd-2.2.17]# vi /usr/local/apache/conf/httpd.conf 修改配置文件第97行 ServerName www.example.com:80去掉#号

[root@localhost httpd-2.2.17]# /usr/local/apache/bin/apachectl start 启动Apache

[root@localhost httpd-2.2.17]# yum -y install lynx 下载测试软件

[root@localhost httpd-2.2.17]# lynx 127.0.0.1 测试

 

转载于:https://www.cnblogs.com/shinian12138/p/11316106.html

你可能感兴趣的:(源代码编译安装apache)