Currently My /etc/apache2/sites-enabled/000-default.conf looks like this:
DocumentRoot /var/www/htm
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Options FollowSymLinks
Require all granted
</Directory>
I have multiple Domains that I want to access Port 80 on my Nas. On my Qnap Each Domain has its own folder titled “domain. com” with “.htaccess”, numerous “.html” containing <!—#exec cgi, <!--#include virtual, and each contain its own “cgi-bin" directory.
Could someone show me what my “.000-default.conf” should look like to accomplish my goals? Thanks!
Rather than put everything in one config file, consider having each of your domains in their own
.conf
file. This will allow you specify more than just which CGI-bin is used.For example:
/etc/apache2/sites-available/000-example-com.conf
/etc/apache2/sites-available/001-secondary-com.conf
/etc/apache2/sites-available/002-tertiary-com.conf
/etc/apache2/sites-available/999-default-com.conf
You can enable (or disable) each of the sites with
a2ensite
, like:This keeps everything separated and "clean". The
999-default
is a "catch all" for Apache to use if web traffic goes to the server for a domain that is not explicitly defined. You can use aServerAlias
line in the.conf
file to achieve this.With this sort of setup, each of your
.conf
files might look something like this:Note: Be sure to replace the values for the site as you need, including the references to the different
cgi-bin
locations.This should give you the specificity (and flexibility) you need to have multiple domains use different versions of software.