How to Create Virtual Sites on Apache2 WebServer

  • Installing Apache2 in Ubuntu

First, lets install Apache2 in Ubuntu. To do that, run the commands below.

sudo apt-get install apache2


After installing Apache2, go and create three separate directory for each website. To do that, run the commands below

sudo mkdir -p /var/www/
sudo mkdir -p /var/www/
sudo mkdir -p /var/www/


After creating those three directories, the next step is to grant permissions to Apache2 for these directories. To do that, run the commands below.

sudo chown -R apache:apache /var/www/


Then give Apache the correct permissions to manage files and folder in these directories.

sudo chmod -R 755 /var/www/


Now that the separate directories are created, how would you tell each one from the other. To do that, we’ll going to be creating separate and unique pages for each of the site.

Our basic sample pages will carry a simple line of text with the name of the website. To do that, create a simple index.html page for

sudo vi /var/www/

<p>It work! Welcome to</p>


The next page is our website. Create a test page and with the same simple message.

sudo vi /var/www/


<p>It work! Welcome to</p>


Do the same for the last website and save it.


After that go and create virtual host directives for each of the three websites. To do that, go and copy the default Apache site configuration file and create our virtual hosts from it.

Run the commands below to do it.

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/


Now that the three separate virtual hosts are created,

sudo vi /etc/apache2/sites-available/

DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


Do the same for each of the other websites and replace the highlighted lines to correspond with the website.

The next things to do is enable the sites. To do that, run the commands below

sudo a2ensite
sudo a2ensite
sudo a2ensite


Restart Apache and test your sites.

sudo service apache2 restart


Now, open your local host file from any machine and enter the same server IP address for each of the website, then save and open your browser and type the domain name. localhost

Type the domain name in your browser and it should work.

How To Create a Sudo User on Ubuntu [Quickstart] | DigitalOcean

The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on Ubuntu, without having to modif

Source: How To Create a Sudo User on Ubuntu [Quickstart] | DigitalOcean

Configuring DNS with NetWare 5 and NetWare 6 and OES


Launching the DNS/DHCP Management Console
Launch the DNS/DHCP Management Console by double-clicking its icon. The DNS/DHCP Management Console can be installed on a client workstation, or it can be accessed from Tools menu of the NetWare Administrator utility.

The first time you launch the DNS/DHCP Management Console, you are prompted to enter the name of the NDS tree where you want to set up DNS. You can click in the Enter NDS Tree Name field to select an NDS tree that you are logged into. Creating a DNS Server Object
Use the DNS/DHCP Management Console to create and set up a DNS Server object for each DNS server you plan to operate.

To create and set up a DNS Server object, complete the following steps:

1.Click the DNS Service tab of the DNS/DHCP Management Console, if necessary.
The All Zones object is the only object displayed on the DNS/DHCP Management Console’s left pane.

2.Click Create on the tool bar.
The Create New DNS Object dialog box is displayed, enabling you to create a DNS Server object or a Zone object.

3.Select DNS Server and click OK.
The Create New DNS Server dialog box is displayed, prompting you to select a DNS Server object.

4.Enter the desired server’s name or use the browse button to select the server.
5.Enter the server’s Fully Qualified Domain name, then click Create.
The DNS Server object is created and displayed in the lower pane of the DNS/DHCP Management Console.

6. Add a forwarder. Hightlight the DNS_Server object you just created. Click on Forwarding List. Click ADD, Add your ISP DNS servers IP addresses
D.        Creating a Primary DNS Zone Object

After you create a DNS Server object, use the DNS/DHCP Management Console to create and set up a Primary DNS zone. For information about how to create a secondary DNS Zone object refer to “Creating a Secondary DNS Zone Object.” For information about how to create an IN-ADDR.ARPA Zone object, refer to “Creating an IN-ADDR.ARPA Zone Object.” For information about how to create an IP6.INT Zone object,
refer to “Creating an IP6.INT Zone Object.”

To create a primary DNS Zone object, complete the following steps:

1.Click the DNS Service tab of the DNS/DHCP Management Console.
The All Zones object and the Root Server Info Zone object are displayed in the DNS/DHCP Management Console’s left pane.

2.Click Create on the tool bar, select Zone, then click OK.
The Create Zone dialog box is displayed. The default setting is to create a new, primary zone.

3.Use the browse button to select the NDS context for the zone.

4.Enter a name for the Zone object in the Zone Domain Name field.

5.In the Assign Authoritative DNS Server field, select a DNS server.
Once you have selected an authoritative DNS server, the Name Server Host Name field is filled with name of the authoritative DNS server.

6.Click Create.
A message is displayed indicating that the new zone has been created, and you are reminded to create the Address record for the host server domain name and corresponding Pointer record in the IN-ADDR.ARPA zone (if you have not already done so).

E.        Starting the DNS Server

After you have created and set up a DNS Server object and a DNS Zone object, enter the following command at the DNS server console:

After NAMED.NLM is loaded, the DNS server can respond to queries for the zone. For more detailed information about NAMED.NLM command line options, refer to “NAMED Command Line Options.”
F.        Configuring Clients to Use DNS
Configuring clients to use DNS is performed at the client workstation.
To configure Windows NT or Windows 95 client workstations to use DNS, complete the following steps:

1.At the client desktop, select Start > Settings > Control Panel, then double-click Network.
The Network window is displayed, listing the network components installed on the client workstation.

2.Select TCP/IP, then click Properties.
The TCP/IP Properties window is displayed, usually showing the IP Address tab page.

3.Click the DNS Configuration tab.

4.Provide a hostname and domain name for each client.

5.Enter the IP address of DNS servers for this client in the reverse search order of preference, then click OK.
The client can now send DNS queries to the DNS name server.

How to install & configure a SunRay Server 4.2 on Solaris 10


[SRSS 4.2] How to install Sunray Server 4.2 on Solaris 10?
Posted in: Sun by Nico Maas on July 30, 2009
Sun Ray Server Software (SRSS) 4.2
Patches for SRSS4.2
Solaris Version: SRSS 4.2 requires Solaris 05/09 (u7) verify you have the correct version.
#cat /etc/release
Solaris 10 5/09 s10x_u7wos_08 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 30 March 2009
1.) Got root?
2.) Extract the software:
# unzip
3.) Install Java (SRSS 4.2 needs java 1.6 or higher.)C
Check your java version with the following command:
# java -version
Install java 1.6 on your system. The script is chip dependent. Pick x64 or Sparc
# ./srss_4.2/Supplemental/Java_Runtime_Environment/Solaris/
# mv jre1.6.0_13/ /usr/jdk/
# rm /usr/java
# ln -s /usr/jdk/jre1.6.0_13/ /usr/java
4.) Install Apache Tomcat
# /usr/sfw/bin/gtar -xvz -C /opt -f srss_4.2/Supplemental/Apache_Tomcat/apache-tomcat-5.5.20.tar.gz
# ln -s /opt/apache-tomcat-5.5.20 /opt/apache-tomcat
5.) Install the Sun Ray Server Software
# ./srss_4.2/utinstall
take all of the defaults
Note: Now is when we would apply patches. Since this a new release there are not any yet.
# reboot
6.) Configure the Sun Ray Server Software:
# /opt/SUNWut/sbin/utconfig
Take all of the defaults except for:
Enable remote server administration? (y/[n])? y
Configure Sun Ray Kiosk Mode? (y/[n])? y
7.) Configure the parms file and tell the server what firmware to offer out
# mkdir /tftpboot
# vi /tftpboot/srssconfig
The file should look like the following:
# /opt/SUNWut/sbin/utfwadm -A -a -V -i /tftpboot/srssconfig -f /opt/SUNWut/lib/firmware
8.) Turn on LAN connections:
# /opt/SUNWut/sbin/utadm -L on
# /opt/SUNWut/sbin/utrestart -c
At this point you have a basic Sun Ray server up and running. Any Sun Rays on the network should be displaying the Solaris log in and you should be able to log into your Solaris server through a Sun Ray.
Personal Notes:  Be careful when you make the link for Java.

To Change a Network Card to Use DHCP–Solaris 10

The following can be done

ifconfig -a — Use this to find the NIC interface

touch /etc/<interface-name>.dhcp — This will be an empty file

touch /etc/hostname.<interface-name> — This file should contain the hosname of the machine

Reboot the machine (or)

ifconfig <interface-name> unplumb
ifconfig <interface-name> plumb
ifconfig <interface-name> dhcp (or)
ifconfig <interface-name> dhcp start


touch /etc/hme0.dhcp

echo “sunfire” > /etc/hostname.hme0

ifconfig hme0 unplumb
ifconfig hme0 plumb
ifconfig hme0 dhcp (or) ifconfig hme0 dhcp start

Change from DHCP to Static IP on Solaris 10


Reconfigure DHCP for a Static IP.
Had to do this to many times and its easy to miss a step, so here is how you change your previously DHCP configured network interface to have a Staticly assigned IP address. This is for Solaris 10 specifically, but its the same concept for linux systems as well. Most of the files will be the same as well.

1. First you need to find out the interfacename. Simplest way is probably to do an ‘ifconfig -a’ and see which interface has an ipaddress. Also there are two DHCP files for each network interface, they are:
2. So you know your interface now (possibly, hme0, qfe0, eth0, eth1 etc). Now we are going to manually edit/create some networking config files if they don’t exist.
Insert the hostname you want your machine to have into the file:
# echo flossyface > /etc/hostname

Insert the same hostname and ip address into the file /etc/hosts. (Seperated by a tab).
123.456.789.012 flossyface
Insert the same hostname into the file /etc/hostname.INTERFACENAME
# echo flossyface > /etc/hostname.qfe0
Insert the network name and the netmask into /etc/inet/netmasks
Insert your default router ip address into /etc/defaultrouter
add your nameservers to /etc/resolv.conf
3. Delete the dhcp files mentioned in the beginning. (qfe0 in this example.)

# rm /etc/dhcp.qfe0
# rm /etc/dhcp/qfe0.dhc
now that all files are prepared do the following:
# pkill dhcpagent
# svcadm restart network/physical

‘ifconfig -a’ – if the right interface has the right address.
‘netstat -nrv’ – if you have the right routes setup.
‘dladm show-link’ – if you are running Solaris 10 check that command as well.
Category: Solaris

Activating the Network Management Port–serial port setup

Activate the Network Management Port
By itsiti on November 12, 2010 in Solaris · 1 Comment · Updated on Sep 13, 2011

1. Log in to ILOM service processor via serial management port [SER MGT].
2. Set the working directory.
-> cd /SP/network
3. Type the following commands [static IP address]:
-> set /SP/network state=enabled
Set ’state’ to ’enabled’

-> set /SP/network
Set ’pendingipaddress’ to ’’

-> set /SP/network pendingipdiscovery=static
Set ’pendingipdiscovery’ to ’static’

-> set /SP/network
Set ’pendingipnetmask’ to ’’

-> set /SP/network
Set ’pendingipgateway’ to ’’

-> set /SP/network commitpending=true
Set ’commitpending’ to ’true’
4. To verify
-> show /SP/network
5. Test the network management port [NET MGT] connection.
Tags: net management port
Get Daily Updates Directly to Your Mailbox:
Read more: