编译httpd的configure: error: Size of "void *" is less than size of "long"

本文介绍了解决httpd2.4.12在特定配置下出现的编译错误:Size of 'void *' is less than size of 'long'的方法。通过调整配置参数,加入ap_cv_void_ptr_lt_long=no选项,成功解决了该问题。

编译httpd 2.4.12

CC="arm-linux-gcc"  ./configure --prefix=/opt/arm-linux/ --without-execstrip --enable-module=so --host="arm-linux"--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

configure: error: Size of "void *" is less than size of "long"


1、移除--with-pcre=/xxx/xxx/pcre选项,未尝试,

2、增加 ap_cv_void_ptr_lt_long=no ,可行。

<think> 我们正在处理用户的问题:“我想查找httpd autoindex出现错误的解决方案 请问httpd autoindex错误解决方案” 根据之前的引用,我们知道引用[1]提到了关于apache默认目录页autoindex的配置问题,并给出了两个检查点: 1. 确保Apache模块mod_autoindex和mod_include已经启用。 2. 确保在DocumentRoot目录上设置了AllowOverride All。 另外,引用[2]说明了<Directory>配置块是针对特定目录的,所以我们需要在正确的<Directory>配置块中进行设置。 因此,我们可以提供以下解决方案步骤: 步骤1:启用必要的Apache模块 使用命令启用mod_autoindex和mod_include,并重启Apache。 具体命令(根据系统可能略有不同,这里以常见的Linux发行版为例): sudo a2enmod autoindex sudo a2enmod include sudo systemctl restart apache2 步骤2:配置AllowOverride 在Apache的配置文件中(例如在/etc/apache2/apache2.conf或/etc/httpd/httpd.conf,或者在sites-available/下的站点配置文件), 找到对应网站目录的<Directory>配置块,并设置AllowOverride All。 例如: <Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> 步骤3:重启Apache服务 sudo systemctl restart apache2 # 或者使用apachectl restart 步骤4:检查是否还有错误 重新访问目录页面,查看是否正常显示。 另外,如果问题仍然存在,可以检查以下几点: - 确保目录中存在index.html(或类似索引文件)吗?如果不存在,autoindex才会生效。如果有索引文件,autoindex默认不会显示目录列表。 - 检查Apache错误日志(通常位于/var/log/apache2/error.log或/var/log/httpd/error_log)以获取具体错误信息。 根据以上步骤,我们可以回答用户的问题。 同时,我们按照要求生成相关问题: 相关问题: 1. 如何启用Apache模块? 2. 如何配置Apache的目录权限? 3. 如何查看Apache的错误日志? 注意:引用标识的使用。我们在回答中引用了之前的引用[1]和[2],但用户提供的引用内容有限,我们主要根据引用[1]提供了解决方案。 因此,我们在回答中在引用到的地方添加引用标识。 </think>### httpd autoindex 错误解决方案 解决 Apache 的 `autoindex` 目录列表功能错误时,请按以下步骤操作: 1. **检查模块启用状态** 确保以下必需模块已启用(使用命令): ```bash sudo a2enmod autoindex sudo a2enmod include sudo systemctl restart apache2 ``` 验证模块是否加载: ```bash apachectl -M | grep autoindex apachectl -M | grep include ``` [^1] 2. **配置目录权限** 在 Apache 配置文件(如 `/etc/apache2/apache2.conf` 或虚拟主机文件)中,确保目标目录配置包含: ```apache <Directory /your/target/path> Options +Indexes # 启用目录列表 AllowOverride All # 允许.htaccess覆盖配置 Require all granted # 开放访问权限 </Directory> ``` [^2] 3. **检查索引文件冲突** 删除目标目录下的默认索引文件(如 `index.html`),因为 `autoindex` 仅在无索引文件时生效: ```bash rm /path/to/directory/index.* ``` 4. **验证配置语法** 重启前检查配置是否正确: ```bash apachectl configtest sudo systemctl restart apache2 ``` 5. **检查错误日志** 查看具体错误信息定位问题: ```bash tail -f /var/log/apache2/error.log ``` **常见问题原因**: - 未启用 `mod_autoindex` 或 `mod_include` - 目录配置中缺少 `Options +Indexes` - `.htaccess` 被禁用(需 `AllowOverride All`) - 存在 `index.html` 等索引文件 - 目录权限不足(需 `Require all granted`)
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值