|
我编译了apache2.2.16到我的机器上,配置文件是默认的,我只修改了ServerName为我的ip地址。可是启动后无法打开页面。
编译的参数为--enable-mods-shared=all --enable-ssl -with-mpm=worker,开启使用了ssl,并编译全部模块,使用worker为多路处理模块
使用lynx查看显示无法连接。
- lynx 127.0.0.1
- Looking up 127.0.0.1 first
- Looking up 127.0.0.1
- Making HTTP connection to 127.0.0.1
- Sending HTTP request.
- HTTP request sent; waiting for response.
- Alert!: Unexpected network read error; connection aborted.
- Can't Access `http://127.0.0.1/'
- Alert!: Unable to access document.
- lynx: Can't access startfile
复制代码
使用netstat查看时却看不到apache已经在监听80端口
#netstat -an
- Active Internet connections (servers and established)
- Proto Recv-Q Send-Q Local Address Foreign Address State
- tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
- tcp 0 0 172.16.3.4:22 172.16.3.119:3286 ESTABLISHED
- tcp 0 52 172.16.3.4:22 172.16.3.119:3242 ESTABLISHED
- udp 0 0 0.0.0.0:514 0.0.0.0:*
- Active UNIX domain sockets (servers and established)
- Proto RefCnt Flags Type State I-Node Path
- unix 2 [ ACC ] STREAM LISTENING 16146 /var/run/cgisock.14724
- unix 2 [ ] DGRAM 118 @/org/kernel/udev/udevd
- unix 2 [ ] DGRAM 1217 /dev/log
- unix 3 [ ] DGRAM 123
- unix 3 [ ] DGRAM 122
复制代码
但是使用ss查看端口时可以看到apache已经在监听80端口并有连接连入。
- #ss -a -A tcp,udp
- Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
- udp UNCONN 0 0 *:syslog *:*
- udp UNCONN 0 0 :::syslog :::*
- tcp LISTEN 0 128 :::apache :::*
- tcp LISTEN 0 128 :::ssh :::*
- tcp LISTEN 0 128 *:ssh *:*
- tcp ESTAB 0 0 172.16.3.4:ssh 172.16.3.119:e-net
- tcp TIME-WAIT 0 0 ::ffff:172.16.3.4:apache ::ffff:172.16.3.119:gf
- tcp ESTAB 0 0 172.16.3.4:ssh 172.16.3.119:sdp-id-port
复制代码
使用Nmap扫描时也可以看到80号的端口启动了。
- # nmap 172.16.3.4 -v
- Starting Nmap 4.62 ( http://nmap.org ) at 2010-10-15 11:51 CST
- Initiating ARP Ping Scan at 11:51
- Scanning 172.16.3.4 [1 port]
- Completed ARP Ping Scan at 11:51, 0.00s elapsed (1 total hosts)
- Initiating Parallel DNS resolution of 1 host. at 11:51
- Completed Parallel DNS resolution of 1 host. at 11:51, 0.00s elapsed
- Initiating SYN Stealth Scan at 11:51
- Scanning 172.16.3.4 [1715 ports]
- Discovered open port 80/tcp on 172.16.3.4
- Discovered open port 22/tcp on 172.16.3.4
- Completed SYN Stealth Scan at 11:51, 0.10s elapsed (1715 total ports)
- Host 172.16.3.4 appears to be up ... good.
- Interesting ports on 172.16.3.4:
- Not shown: 1713 closed ports
- PORT STATE SERVICE
- 22/tcp open ssh
- 80/tcp open http
- MAC Address: 00:23:9E:00:03:1B (Unknown)
- Read data files from: /usr/share/nmap
- Nmap done: 1 IP address (1 host up) scanned in 0.486 seconds
- Raw packets sent: 1716 (75.502KB) | Rcvd: 1716 (78.932KB)
复制代码
在apache启动出错日志中可以看到apache工作是正常的。
- #cat /var/log/apache/error_log
- [Fri Oct 15 03:52:54 2010] [info] mod_unique_id: using ip addr 127.0.0.1
- [Fri Oct 15 03:52:55 2010] [notice] Digest: generating secret for digest authentication ...
- [Fri Oct 15 03:52:55 2010] [notice] Digest: done
- [Fri Oct 15 03:52:55 2010] [info] mod_unique_id: using ip addr 127.0.0.1
- [Fri Oct 15 03:52:56 2010] [notice] Apache/2.2.16 (Unix) DAV/2 configured -- resuming normal operations
- [Fri Oct 15 03:52:56 2010] [info] Server built: Oct 15 2010 01:14:25
- [Fri Oct 15 03:52:56 2010] [debug] worker.c(1757): AcceptMutex: sysvsem (default: sysvsem)
复制代码 |
|