我用./vhost 设置,想用内网访问,apache具体配置如下

问答中心分类: Linux我用./vhost 设置,想用内网访问,apache具体配置如下
lebuy asked 7 年 ago
<VirtualHost *:32491>
ServerAdmin admin@example.com
DocumentRoot "/data/wwwroot/192.168.2.10:32491"
ServerName 192.168.2.10
ErrorLog "/data/wwwlogs/192.168.2.10:32491_error_apache.log"
CustomLog "/data/wwwlogs/192.168.2.10:32491_apache.log" common
<Directory "/data/wwwroot/192.168.2.10:32491">
SetOutputFilter DEFLATE
Options FollowSymLinks ExecCGI
Require all granted
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>
我想通过 192.168.2.10:32491  来访问项目,请看看这个配置哪里错误了?无法访问到项目!

4 Answers
oneinstack answered 7 年 ago
/usr/local/apache/conf/httpd.conf
Listen端口没加。。

lebuy answered 7 年 ago
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen 0.0.0.0:32491
Listen [::0]:32491
 
这个Listen我确实添加了,光加  Listen 32491 也不行 不知道怎么回事?

oneinstack answered 7 年 ago

iptables

lebuy answered 7 年 ago
我使用了  iptables -A INPUT -p tcp --dport 32491 -j ACCEPT  添加端口 还是不行 具体应该怎么操作呢?