Configuring <VirtualHost> (Apache 2.4 on Raspberry Pi)


#1

Hello all,

Background

I manage about 20 small websites (mostly as sub-domains) hosted on a Raspberry Pi under “Raspian” (Debian based). Though security is not a great concern I hope to switch gradually to https - encouraged by Google and by coming across Let’s Encrypt (probably through Linux Journal). I’m experimenting with two domains, both accessible with or without a www. prefix. I’ll call them website.xx and website.yy below.

For various reasons I changed the site file ownership and group to www:www (set in envvars) and sites, sites-available and sites-enabled are under /home/www/ (set in apache2.conf). Another change is that when I upgraded from A2.2 to A2.4 I did not add “.conf” to the files in sites-available (example: /home/www/sites-available/website.xx) but do add “.conf” in sites-enabled (using my own enable and disable scripts).

##website.xx
I tried this first selecting “Apache” and “Other Unix” and certbot-auto but had failed to port forward 443 to the Pi or run “a2enmod ssl”. The www entry occured before the simple one in the website list - don’t understand why. Eventually I ended up with a certificate for the www. version (only) but had to configure VirtualHost manually. It works.

##website.yy
I ran this choosing “Other Debian”. It presented the basic and www. entries in the expected order and created a certificate - for both, I presume. However, it ended up saying “Unsupported filesystem layout. sites-available/enabled expected.” So I need to do a manual configuration or sort out what is wrong.

##A request
I’m not sure as to the best entries to put in VirtualHost for port 443 and would like to see some actual examples (possible with comments stripped) if anyone would care to post theirs.

Thanks for reading.


#2

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.