0

When I try to Apache web address (192.168.0.21) from LAN computers, it is accessed successfully.

I have created one website 10000MT in Apache web server and written below code in etc/apache2/sites-avaiable/10000MT.conf file.

<VirtualHost *:80>
    DocumentRoot "var/www/10000MT"
    ServerName 10000MT
</VirtualHost>

But when I try to access this website using 192.168.0.21/10000MT, it is giving below error message.

Not Found

The requested URL /10000MT was not found on this server.
Apache/2.2.22 (Ubuntu) Server at 192.168.0.21 Port 80

Please let me know what changes I need to do to access this website from LAN computers. But I can access site without any issue from linux pc but not from other pcs from LAN.

EDIT:

etc/apache2/sites-avaiable/10000MT.conf - This file contains following mentioned code.

<VirtualHost *:80>
    DocumentRoot "var/www/10000MT"
    ServerName 10000MT
</VirtualHost>

etc/apache2/sites-enabled/10000MT.conf - This file contains following mentioned code.

<VirtualHost *:80>
    DocumentRoot "var/www/10000MT"
    ServerName 10000MT
</VirtualHost>
  • You need to access you server like this http://10000MT/. If you get DNS error then add this to your hosts file 192.168.0.21 10000MT. – mbiber May 26 '16 at 15:17
  • I already added above line my hosts file. And when I am trying to access site like you suggested above, it is still giving 'not found' error... – K Ahir May 26 '16 at 15:24
  • you didn't mention it but did you link the 10000MT file to the sites-enabled folder? then restart apache2 – John Orion May 26 '16 at 15:37
  • As a follow-up to @JohnOrion's comment, you can link it by running sudo a2ensite 10000MT. – Dan May 26 '16 at 18:39
  • Yes, it is linked... I have updated my initial question with this info... – K Ahir May 27 '16 at 3:39
0

If you want to access 192.168.0.21/10000MT in a web browser, you don't need to create a virtual host for that. Just move 10000MT folder inside /var/www/html. See default document root in /etc/apache2/sites-enabled/000-default.conf.

|improve this answer|||||
  • I didn't understand your answer until today when I read this again. Ty for this. But then why virtual host are so much important and how can it be used? Can you please provide some reference or brief explaination? Ty again... – K Ahir Sep 1 '16 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.