Creating virtual Servers in Apache2 using Webmin

I like Webmin. I can edit configuration files, but I have to confess that I don’t memorize the syntax and options, so I only edit configuration files when I need to copy and change something quick.

If I am going to start from scratch, then Webmin is my tool of choice.

I won’t cover in detail how to install Webmin, but here is the short version:

Using apt-get

sudo sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list' wget -qO - http://www.webmin.com/jcameron-key.asc | sudo apt-key add - sudo apt-get update sudo apt-get install webmin

If you use Yum:

(echo "[Webmin] name=Webmin Distribution Neutral baseurl=http://download.webmin.com/download/yum enabled=1 gpgcheck=1 gpgkey=http://www.webmin.com/jcameron-key.asc" >/etc/yum.repos.d/webmin.repo; yum -y install webmin)

I recently created a few WordPress sites, and I had to create the Virtual Servers for it, and I run into a tiny problem where it was not working correctly. It drove me crazy, but I took some notes.

Using Webmin is easy to create virtual Server. The process is documented in the Wiki at http://doxfer.webmin.com/Webmin/Apache_Webserver#Creating_a_new_virtual_host

However, we all know that we can’t read that much.

To create a Virtual host (virtual Server) go to Servers>Apache Webserver. Then click the tab that says “Create virtual host” (yes, to create a Virtual Server, you create a virtual host).

The options here are pretty simple. VERY SIMPLE!!

Handle connection to address. Basically this is for multi-homed servers more than anything. If you have an IP address per site, here is where you specify it.

Port: This is the tricky part. You would be tempted to put any right? Here most of the time you actually need to listen the port, which most of the time will be port 80.

Why? Well, because in my case I am using a specific server name, and in most cases you would too, so it seems to work better when you set the port instead of just using default (at least with WordPress).

If you need to use https, then you will have to have a certificate per site, and also a IP address per site. So that will change the previous setting. Adding SSL is similar, but the port would be 443, and you need to have mod_ssl enabled too.

Next enter the root location for the site (for WordPress for example it is /usr/share/wordpress).

After that enter the server name. This would be thisismywebsite.com for example

The Add virtual server to file section should be as it is. The default is to add to sites-available, and then it creates the link in sites enabled.

Finally you can copy directives if needed (this is useful when you have special folders, or if using SSL with a wildcard certificate).

Then click on Create Now, and then apply changes. Your site should be working now.

There are more settings, and it is a good idea to refer to Webmin documentation, or the Apache documentation for them, but my most used settings are

Alias and Redirects. I use it when I have sites located under a master root, but the folders are in other parts of the system. I do this a lot to save files in a separate partition.

In Networking and Addresses you can add alternate virtual server names.

Directory indexing is another section you might change, if you need to edit access to files.

Edit directives is basically a quick access to the configuration file for the site. So also useful.

That is it!!! Were you expecting something more complex? You can do more complex, but it is always good start simple, and then more from there. The 2 things to watch out for is port 80 instead of any, and dedicate an IP address per site when using SSL.

Of course there are a ton of configurations changes and mix and match settings, but this way you can quickly have multiple sites running.

Advertisements

Updates coming

Ok, so I have been neglecting the blog for a while, such is life.

However I have been playing with some new technology, and different projects, so I have new ideas, and I would like to share them. Worst case scenario this would be my documentation of the ideas

Digital Signage Thoughts

Digital Signage is what you see everywhere now a days. The concept looks rather simple, it is a large format TV displaying some kind of content, usually promotions. The implementation though, it is not as easy.

I have been working in a digital signage project for a few years now. I have put a lot of time, but probably not as much as it needs on the project.

This will be the first in a series of articles, but I wanted to start with some thoughts on it before I go more in deep. This will help anyone also considering digital signage.

  • Cost of Hardware: This is an easy thing to consider. The problem is that we should not put too much emphasis on it. For example, the cost would be TV cost + player (usually a computer or Android based device)
  • Cost of Installation: Another part that needs to be accounted well. Mounting TVs in drywall is a challenge to do it right. If you are not confident enough to do pull ups from the mounting bracket then it is not mounted right. When possible consider professional installation. After installing several I was taking about 1 hour or more per TV (routing power, network cables as well, and finally using the right hardware)
  • Cost of maintaining the project: This is the big part that gets overlooked. And it will vary according to your environment. Don’t go with the cheapest solution, if it will require more time to implement and have running. The reason, is that human resource time needs to be considered as well. I am constantly managing people because they do not know how to maintain the TV for the digital signage. It sounds easy, but the truth is that people will not do basic steps like turning on the TV. This goes with Cost of Hardware point.
  • Distribution of content: this is how you will distribute the content, either using a digital signage distribution system or something homebrew (like HTML)

Now that you have this basic points let me expand a little as a reference.

When considering the hardware you have digital signage base TVs and regular consumer TVs. After a bit of search, we used LG consumer models. They were priced right and have pretty good quality. They were also half the cost of the digital signage model, so this allowed us to use 55″ instead of 42″. Then we used Android base sticks (these are really old now), and Lenovo Tiny M73 computers. The initial test worked great, so we deployed 50 of these.

And that is where the problems starting surfacing

We did not account for people not knowing how to use TVs. People forget to turn them on, did not understand what an input is, and cannot configure the TV.

Our next problem was misinformation. At the beginning we were going to use a smart stick that was powered by the TVs USB port, but we had to change it because the Android device was slow. The users still though just turning the TV turned the PC as well. The problem there was that information got simplified when it was presented the first time (almost a year before full deployment) and the new information was not retained.

We also did not like Windows 7 (Windows 8, and later 8.1) were better for large display, and installation increased deployment time.

(I will expand on the deployment in another article)

What is the underlying problem?

Accountability. If you are using your own equipment, you make sure Wi-Fi is connected and the laptop is on. When it is the company’s, the user simply “does not want to be bothered with it”.

Sounds easy to fix. Simple enough….We covered the issue on meetings, all management agreed, but still something happened when deploying communication downstream. A few weeks later the same problem happened.

What is the solution?

Doing the proper research before the project, and putting all numbers together. We saved a lot of money in hardware, but we spent more on maintaining and making sure it is running. Now the project is running smoother, but not as much as it should.

Quick Recommendations

Use digital signage equipment. Not because it is rated to run 24/7, but because it can be remotely controlled. For example Samsung/LG/NEC/[take your pick] will have a RS232 port, or some connectivity for a controller card. This will allow you to set the TV to turn on automatically, and turn off automatically. It can disable all input ports but what is selected, and will remove end user errors. The cost per installation will double, but the ongoing maintenance will be reduced.

Also, set the right expectations. We went crazy with what we wanted this project to do. 80% of what we were planning was not implemented, and we could have done a simpler job

What is next?

On the next article I will describe what we did, and how we did it, with the challenges we discovered. After that, what I think we should have done with what I learn. Hopefully you can avoid the learning curve.