I have set up a website on my Ubuntu desktop using Apache, but i can't access it from another machine via IP address. Which configurations should I add to access it via IP eg: instead of localhost.


Recommended Answers

All 4 Replies

you have to tell apache what the default web site is for the server put something like this in the httpd.conf file:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common

If your both machines are communicating with each other then other machine can access your server with IP based on the VHOST configuration you have setup (default VHOST will be called by default).

Manoj Samtani

Correct, the virtual host either has to be the first (default) entry for the named based Vhost, are it needs to be setup as an IP based vhost.

:) For more info please refer this link not any more

Manoj Samtani

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.