Just going to do the perl question now. It took me a while to get working again but I got it working again on Debian.
I would keep your mime.conf default and add anything specific for a website within the vhost, that way you don't lose track of what made a website work. You're vhost was kind of basic, wasn't much different from mine but I created one with the same paths in it and you left out VirtualHost definitions. Also it's more readable to use fqdn name for ServerName and ServerAlias since all of the web uses that.
Code:
<VirtualHost *:80>
ServerName perl.example.com
ErrorLog /var/log/apache2/test-error.log
CustomLog /var/log/apache2/test-access.log combined
Loglevel warn
DocumentRoot /var/www/mywebsite
<Directory /var/www/mywebsite>
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Require all granted
</Directory>
</VirtualHost>
You can leave out the log entries but it can be useful to debug stuff and verify things and if you don't define a log file configuration for the vhost everything will end up in the general apache log files, I have the ServerName set in my /etc/hosts file for resolving for localhost. After that the only thing I had to run was "a2enmod cgid" to enable the cgi module for Apache and then reload or restart Apache.
Here's my web files.
Code:
root@debian:# ls -l /var/www/mywebsite/home.htm /var/www/mywebsite/perl.pl
-rw-rw-r-- 1 root root 122 Sep 10 18:54 /var/www/mywebsite/home.htm
-rwxrwxr-x 1 root root 98 Sep 10 18:46 /var/www/mywebsite/perl.pl
[/QUOTE]
Requesting the html website.
[CODE]
root@debian:~# curl perl.example.com/home.htm
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
</body>
</html>
Requesting the perl script.
Code:
root@debian:~# curl perl.example.com/perl.pl
Perl is working on this Apache!
500 are errors, the number after 500 isn't anything important.
The HTTP 500 Internal Server Error server error response status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is a generic "catch-all" response to server issues, indicating that the server cannot find a more...
developer.mozilla.org
Also I tried this as you have in mime.conf
This didn't work because you only have the the DocumentRoot defined in your vhost but you also still need to give the directory permission to execute the script with this part by defining the directory.
Code:
DocumentRoot /var/www/mywebsite
<Directory /var/www/mywebsite>
Options +ExecCGI
Require all granted
</Directory>
In instead of the above you can also do just use the root directory since you have DocumentRoot defined and that is the root directory, which then would look like this.
Code:
DocumentRoot /var/www/mywebsite
<Directory />
Options +ExecCGI
Require all granted
</Directory>
I would still recommend doing it like this because of what I mentioned previously which is because it's easier to keep track of the configurations you used to make the website work than to remember what you changed in some general used file.
Code:
<VirtualHost *:80>
ServerName perl.example.com
ErrorLog /var/log/apache2/test-error.log
CustomLog /var/log/apache2/test-access.log combined
Loglevel warn
DocumentRoot /var/www/mywebsite
<Directory /var/www/mywebsite>
#DirectoryIndex index.pl
Options +ExecCGI
AddHandler cgi-script .cgi .pl .py .sh .rb .go .js .php
AddHandler send-as-is asis
Require all granted
</Directory>
</VirtualHost>
Can you try this, I'm thinking this may also solve your javescript issue when you have those things defined in your vhost. As mentioned before putting all the necessary configurations in your vhost gives you a better overview of what configurations worked for that specific website as you tend to lose track of general configuration files that you edited.
So try out both and see where it gets you.