Ado
view release on metacpan or search on metacpan
lib/Ado/Command/generate/apache2vhost.pm view on Meta::CPAN
Generate your C<.htaccess> file. Since you own the machine,
you can put its content into the C<001-example.com.vhost.conf> file.
$ 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);
=head1 DESCRIPTION
L<Ado::Command::generate::apache2vhost>
generates a minimal Apache2 Virtual Host configuration file for your L<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.
=head1 OPTIONS
Below are the options this command accepts described in L<Getopt::Long>
notation.
=head2 n|ServerName=s
Fully Qualified Domain Name for the virtual host. B<Required!>
See also documentation for Apache2 directive ServerName.
=head2 p|port=i
Port on which this host will be served. Defaults to 80.
=head2 A|ServerAlias=s
Alias for ServerName. Defaults to C<'www.'.$ServerName>.
See also documentation for Apache2 directive ServerAlias.
=head2 a|ServerAdmin=s
Email of the administrator for this host - you.
Defaults to webmaster@$ServerName.
See also documentation for Apache2 directive ServerAdmin.
=head2 D|DocumentRoot=s
DocumentRoot for the virtual host. Defaults to C<$ENV{MOJO_HOME}>.
See also documentation for Apache2 directive DocumentRoot.
=head2 c|config_file=s
Full path to the file in which the configuration will be written.
If not provided the configuration is printed to the screen.
=head2 s|with_suexec
Adds C<SuexecUserGroup> directive which is effective only
if C<mod_suexec> is loaded. The user and the group are guessed from the
user running the command.
=head3 u|user=s
User to be used with suexec.
=head3 g|group=s
Group to be used with suexec.
=head3 v|verbose
Verbose output.
=head1 ATTRIBUTES
L<Ado::Command::generate::apache2vhostn> inherits all attributes from
L<Ado::Command::generate> and implements the following new ones.
=head2 args
Used for storing arguments from the commandline and then passing them to the
template
my $args = $self->args;
=head2 description
my $description = $vhost->description;
$v = $vhost->description('Foo!');
Short description of this command, used for the command list.
=head2 env
Reference to C<%ENV>.
=head2 usage
my $usage = $vhost->usage;
$v = $vhost->usage('Foo!');
Usage information for this command, used for the help screen.
=head1 METHODS
L<Ado::Command::generate::apache2vhost> inherits all methods from
L<Ado::Command::generate> and implements the following new ones.
=head2 run
$vhost->run(@ARGV);
Run this command. Returns C<$self>.
=head1 SEE ALSO
( run in 0.922 second using v1.01-cache-2.11-cpan-5735350b133 )