Breeder is crafted for developers, who want to set up a local LAMP virtual host with a single command in your terminal.
It assumes that you have already set up your LAMP environement, and that you know how it is configured. If you're a dev, you'll certanly know! :)
git clone [email protected]:welaika/breeder.git
cd breeder && sudo make install
sudo breeder -i
Now read and edit the just created ~/.vhostrc
vim ~/.vhostrc
Now enjoy
sudo breeder -s mysite
Open a browser and go to http://mysite.local and start coding
Here you have to configure the following:
apacheconfpath='/etc/apache2/sites-enabled'
web_group="www-data"
logdir="/var/log"
docroot="/var/www"
domain_firstlevel='local'
serveradmin="root@localhost"
mysqluser="root"
mysqlpwd=""
db_prefix=""
mysqlcmd=$(which mysql)
apachecmd="service apache2"
read the in-line comments and all will be clear. Drop an issue if not.
All should be adaptable for any Linux distro and for Mac, [XM]AMPP included, if you know your business.
.vhostrc
is adaptable for XAMPP/MAMPP. Just add in your /opt/lampp/etc/httpd.conf
(or whatever) a section like this:
## Virtual hosts
Include etc/extra/httpd-vhosts.conf #Already present by deafult
Include etc/extra/sites-enabled/*
and create the sites-enabled
dir:
mkdir /opt/lampp/etc/extra/sites-enabled/
then configure your $HOME/.vhostrc
accordingly
Script must be run with sudo
. If you won't, it will try to accomplish
its task anyway, but will warn you about imminent fail. =)
Here the flags:
Usage: breeder.sh -s example [options]
Possible options are:
-s mysitename (mandatory, without first level domain)
-a '.com' (is your first level domain, default is defined in .vhostrc)
-d activate creation of a new DB
-i initialize creating .vhostrc file
-w bootstrap a wordless project inside my new vhost
-L specify a locale for WordPress (defaults to it_IT), e.g. -L en_US
-h display this help
When you call sudo breeder -s example
will happen the following
(default .vhostrc assumed):
-
/var/www/example.local
will be created -
a stand alone vhost config for example.local will be dropped inside
/etc/apache2/sites-enabled
. (N.B.: sites-available is ignored)<VirtualHost *:80> ServerAdmin root@localhost ServerName example.local DocumentRoot /var/www/example.local <Directory /var/www/example.local> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog /var/log/example.local.error.log # Possible values include: debug, info, notice, warn, error, crit, alert, # emerg. LogLevel debug CustomLog /var/log/example.local.access.log combined </VirtualHost>
-
127.0.0.1 example.local
will be added in/etc/hosts
-
will be created a database named example
-
apache will be reloaded
If you'd like to bootstrap a WordLess project than try
sudo breeder -s example -w
or
sudo breeder -s example -w -L en_US
This command will add these behaviours:
- install WordPress (localised, if you choosen -L flag) inside
/var/www/example.local
- install WordLess plugin inside
/var/www/example.local/wp-content/plugins
- initialize a fresh WordLess teheme:
/var/www/example.local/wp-content/themes/example.local
(The MIT License)
Copyright © 2013-2019 weLaika
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.