0

I am just a beginner. I have installed an Ubuntu virtual server 14.03 on a widows 8.1 host.I have lamp server ,phpmyadmin installed and working fine. I can access files on both the host and guest machine through putty and winsp. I just want to know for a start how host web pages from the host and access them from the browser. Please help.

0

Go to browser and type http://localhost/, it's a default virtual host and files located in /var/www/html directory. For creating simple virtual host like example-com, follow these steps:

  1. Open /etc/hosts and add to the end 127.0.0.1 example-com.

  2. Create directory /var/www/example-com: sudo mkdir /var/www/example-com.

  3. Copy index.html and other files from /var/www/html to /var/www/example-com.

  4. Create example-com.conf in /etc/apache2/sites-available and add this code:

<VirtualHost *:80>
    ServerName example-com
    ServerAlias example-com

    DocumentRoot /var/www/example-com

    <Directory /var/www/example-com>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
  1. Enable virtual host: sudo a2ensite example-com.conf.

  2. Reload Apache: sudo service apache2 reload.

  3. Go to browser and type http://example-com/.

  • I thank you very much for your detailed and timely explanation – bellodalhatu Nov 27 '15 at 21:02

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.