kwan schrieb am 25.05.2007 01:23:
> I've set my main PC with Apache 2.2.4, PHP 5.2.0 and MySQL 5.0.27.
> On there, if I browse tohttp://localhost/orhttp://127.0.0.1/I get
> the website that I'm developing.
> But... If I try to access it via my laptop with the correct IP address
> (http://192.168.1.98/) it won't connect.
> In my httpd.conf file I have the following settings for the listening
> ports:
> #Listen 12.34.56.78:80
> Listen 80
> #Listen 192.168.1.98:80
> I did try it without the # infront of Listen 192.168.1.98:80 but
> nothing happened so I disabled it.
> What am I doing wrong?
"Werner Flamme" asked:
: Why do you reply to *my* posting? It was not me who had this
: problem! ;-)
My reply is in context.
Try something along the lines of the following:...
#
# NOTE: No listen directive required.
# IP address goes into the first VirtualHost as ServerName.
# Then specific domains get configured one at a time. Then place
# your subdomains prior to the domain entries to handle those
# appropriately. Apache STOPS going through the .conf file at
# the first successful match.
#
Port 80
NameVirtualHost *:80
#
# ... other stuff as needed ...
#
<VirtualHost *:80>
# Leave the trailing forward slash off
# ... represents some unknown path to the targeted folder/file, fill
# it in with whatever is appropriate for your system.
#
DocumentRoot "Z:/.../.../path_to/subdomain/folder"
ServerName 192.168.1.98
ErrorLog ...
CustomLog ...
</VirtualHost>
# Place all other virtual hosts under the first one above.
# Keep the order of subdomain / domain intact...
<VirtualHost *:80>
DocumentRoot "..."
ServerName subdomain.example.com
ErrorLog ...
CustomLog ...
</VirtualHost>
<VirtualHost *:80>
# Handle bad domain name typos
ServerName subdomain.example.com
ServerAlias *.subdomain.example.com
Redirect 301 /
http://subdomain.example.com/
</VirtualHost>
#
# Handle the parent domain...
#
<VirtualHost *:80>
ServerName example.com
ErrorLog ...
CustomLog ...
</VirtualHost>
--
Jim Carlock
Post replies to the group.