Skip to content
View in the app

A better way to browse. Learn more.

Gear Crushers

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create Virtual Apache Hosts

Featured Replies

  • Moderators

Virtual Hosts


Apache2 has the concept of sites, which are separate configuration files that Apache2 will read. These are available in /etc/apache2/sites-available. By default, there is one site available called default this is what you will see when you browse to http://localhost or http://127.0.0.1. You can have many different site configurations available, and activate only those that you need.


As an example, we want the default site to be /home/user/public_html/hosangit.com. To do this, we must create a new site and then enable it in Apache2.


To create a new site:


    Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/hosangit


    Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: gksudo gedit /etc/apache2/sites-available/hosangit


    Change the DocumentRoot to point to the new location. For example, /home/user/public_html/hosangit.com


    Change the Directory directive, replace to


    You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites

    Save the file


Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this: a2ensite (apache2enable site) and a2dissite (apache2disable site).


$ sudo a2dissite default && sudo a2ensite hosangit


Finally, we restart Apache2:


$ sudo /etc/init.d/apache2 restart


If you have not created /home/user/public_html/hosangit.com, you will receive an warning message


To test the new site, create a file in /home/user/public_html/hosangit.com:


$ echo 'Hello! It is working!' > /home/user/public_html/hosangit.com/index.html


Finally, browse to http://localhost/


Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.