Category:Vans
Category:Sports entertainment
Category:Motorsport terminologyQ:
Can we have more than one virtual hosts in a single site?
I have multiple web applications running in Apache 2.2. The virtual hosts are in a separate conf file. Can we have more than one virtual hosts in a single site?
A:
Yes, you can have multiple virtual hosts defined in a single site.
But, to use this, you have to move your (existing) config file outside of /var/www.
Create /etc/apache2/sites-available/example.com.conf:
ServerName example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/example.com/public
Create /etc/apache2/sites-enabled/example.com.conf:
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Then, enable the new site with a2ensite:
$ sudo a2ensite example.com
For more information on this topic, see the Virtual Hosts documentation
Q:
How can we make our code more readable when using private members
I just realized that a very readable code can be achieved by using the private members in the class. For example,
class Sender
{
private string _description;
public string Description
{
get { return _description; }
}
}
class Message
{
private Sender sender;
public Sender Sender
{
get { return sender; }
}
}
class Program
{
static void Main(string[] args)
{
var message = new Message { Sender = new Sender { Description = "I am using private members in the class" } };
}
}
Using this approach, our code will become more readable. So, how ac619d1d87
Related links:
Comentarios