Skip to content

Instantly share code, notes, and snippets.

@scottoffen
Last active August 29, 2015 14:10
Show Gist options
  • Save scottoffen/ae48162bcf00c8194532 to your computer and use it in GitHub Desktop.
Save scottoffen/ae48162bcf00c8194532 to your computer and use it in GitHub Desktop.
Modifying VirtualHost using EasyApache

WHMs EasyApache

Solution Used

Custom Directives Outside of a VirtualHost Tag

I created a copy of vhost.default at /var/cpanel/templates/apache2 named vhost.local, found the first line listed below and added the second line below it.

    ScriptAlias /cgi-bin/ [% vhost.documentroot %]/cgi-bin/
    ScriptAlias /services/ [% vhost.documentroot %]/services/

Alternatives

Create/edit the appropriate file as indicated in the table. For example:

ScriptAlias "/services/" "/full/path/to/services/"
<Directory "/full/path/to/services/">
	SetHandler cgi-script
	Options ExecCGI
</Directory>

And then restart Apache.

If you wish to change the content of all future virtualhost containers that cPanel & WHM creates for accounts, read the Custom Templates documentation.

Follow the instructions found there.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment