Code Monkey home page Code Monkey logo

breeder's Introduction

Breeder

Let it bring up your local virtual hosts

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! :)

Build Status

In a hurry

	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

In depth

.vhostrc

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.

{X,M}AMPP

.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

Command line options

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
The dirty work

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

Bootstrapping WordLess

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

License

(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.

breeder's People

Contributors

alessandro-fazzi avatar namuit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

breeder's Issues

Vhost file not see on debian

Breeder it's fantastic but i have see that in the debian config of apache the directive:

IncludeOptional sites-enabled/*.conf

Conflict with the vhost file generated with breeder because they don't have extension.
Si i have changed the directive with IncludeOptional sites-enabled/* but i think that a check on the generation of the file it would be better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.