zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Linux安装Apache

2023-09-11 14:21:36 时间

一、查看版本

 
httpd -d
 
二、安装过程
1、参考过程
 
 
设置目录命令 
./configure --prefix=/usr/local/web/apache
 
2、如果需要安装arp、arp-util可参考
不用安装pcre
 
3、启动httpd
service httpd start
 
4、验证安装是否成功:浏览器输入localhost,默认端口为80
 
安装异常
1、configure: error: no acceptable C compiler found in $PAT
     解决:yum install gcc
2、Apache: 提示configure: error: APR not found  
3、安装apr-util执行./configure报错,改为以下语句
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
 
 
三、设置(修改端口)
1、apache默认目录:/etc/httpd/conf
2、默认端口:改为81
 
如果是linux自己带的apache的话就使用命令 
service httpd start 启动 
service httpd stop 关闭 
service httpd restart 重新启动