Ado::Command::generate::apache2vhost - Generates minimal Apache2 Virtual Host configuration file
On the command-line:
$ bin/ado generate apache2vhost --ServerName example.com -s \ > etc/001-example.com.vhost.conf
Review your newly generated 001-example.com.vhost.conf!!! Create link to your generated configuration.
001-example.com.vhost.conf
# ln -siv /home/you/dev/Ado/etc/001-example.com.vhost.conf \ /etc/apache2/sites-enabled/001-example.com.vhost.conf # service apache2 reload
Generate your .htaccess file. Since you own the machine, you can put its content into the 001-example.com.vhost.conf file.
.htaccess
$ bin/ado generate apache2htaccess --modules fcgi \ > $MOJO_HOME/.htaccess
Programmatically:
use Ado::Command::generate::apache2vhost; my $vhost = Ado::Command::generate::apache2vhost->new; $vhost->run('--ServerName' => 'example.com', '-p' => 8080);
Ado::Command::generate::apache2vhost generates a minimal Apache2 Virtual Host configuration file for your Ado application.
This is a core command, that means it is always enabled and its code a good example for learning to build new commands, you're welcome to fork it.
Below are the options this command accepts described in Getopt::Long notation.
Fully Qualified Domain Name for the virtual host. Required! See also documentation for Apache2 directive ServerName.
Port on which this host will be served. Defaults to 80.
Alias for ServerName. Defaults to 'www.'.$ServerName. See also documentation for Apache2 directive ServerAlias.
'www.'.$ServerName
Email of the administrator for this host - you. Defaults to webmaster@$ServerName. See also documentation for Apache2 directive ServerAdmin.
DocumentRoot for the virtual host. Defaults to $ENV{MOJO_HOME}. See also documentation for Apache2 directive DocumentRoot.
$ENV{MOJO_HOME}
Full path to the file in which the configuration will be written. If not provided the configuration is printed to the screen.
Adds SuexecUserGroup directive which is effective only if mod_suexec is loaded. The user and the group are guessed from the user running the command.
SuexecUserGroup
mod_suexec
User to be used with suexec.
Group to be used with suexec.
Verbose output.
Ado::Command::generate::apache2vhostn inherits all attributes from Ado::Command::generate and implements the following new ones.
Used for storing arguments from the commandline and then passing them to the template
my $args = $self->args;
my $description = $vhost->description; $v = $vhost->description('Foo!');
Short description of this command, used for the command list.
Reference to %ENV.
%ENV
my $usage = $vhost->usage; $v = $vhost->usage('Foo!');
Usage information for this command, used for the help screen.
Ado::Command::generate::apache2vhost inherits all methods from Ado::Command::generate and implements the following new ones.
$vhost->run(@ARGV);
Run this command. Returns $self.
$self
Apache deployment, Apache - Upgrading to 2.4 from 2.2, Mojolicious::Guides::Cookbook, Ado::Command::generate::apache2htaccess, Mojolicious::Command::generate, Getopt::Long, Ado::Command Ado::Manual, Mojolicious, "DEPLOYMENT" in Mojolicious::Guides::Cookbook
To install Ado, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ado
CPAN shell
perl -MCPAN -e shell install Ado
For more information on module installation, please visit the detailed CPAN module installation guide.