Coder Social home page Coder Social logo

ousamabenyounes / shellvhostmanager Goto Github PK

View Code? Open in Web Editor NEW
34.0 8.0 3.0 19.57 MB

Helps you managing LAMP basic needs (virtualHost, Ftp users, Mysql Database)

License: Apache License 2.0

Shell 94.19% Smarty 5.81%
shell prestashop lamp vhost-builder vhost proftpd mysql

shellvhostmanager's Introduction

ShellVhostManager

This shell script helps you managing LAMP basic needs (virtualHost, Ftp users, Mysql Database) You have a linux server, and you always lose time configuring your websites, downloading last cms versions, installing mysql databases... This script will help you earn time and let you focus on managing your contents.

This shell script was developped & tested on an Ubuntu 12.10

Configuration

First, rename conf.sh.dist to conf.sh
And then you must just specify your mysql administrator login & password.

Usage

ShellVhostManager.sh -H -d -p -f -m -l -c -v -s -h -t -r -k
  -H: Host .  
  -p: Project name.  
  -d: Domains(fr|com|net).  
  -f: Ftp User Name (will generate user pwd)  
  -m: Mysql username (will generate user pwd) DB name will be the host name  
  -l: Passwords length. (default 10 chars)  
  -c: CMS/Framework/Repository to install (allowed values are: wordpress, prestashop, sf2, owncloud, seafile, import, git, hg, svn)  
  -v: CMS/Framework Version (By Default last version is allready set)  
  -s: Subdomain.  
  -h: Print this Help.  
  -t: Log Type (echo|file) to get silent mode set it to file."  
  -r: Repository url we want to clone (git/hg/svn)    
  -k: Keep this vhost protected with htaccess/htpasswd (login|passwd)   
 

Sample

$ ./bin/ShellVhostManager.sh -p myprojects -H prestashop -d "fr|com|tk" -f ous -c prestashop -m DbUsr -D DbName
  • First This will create web root directory (/var/www/myprojects/prestashop.fr/
  • Create log directory & files (/var/log/apache2/myprojects/prestashop.fr/error.log & access.log
  • Create FTP user: ous:ftpgroup with home directory => previous created web root dir
  • Create MySQL config: database=prestashop User=ous Pwd=generatedPasswd
  • Create Vhost: /etc/apache2/site-available/prestashop.fr from a vhost template
    Also added aliases for the given extentions: fr & com & tk
    Enable the vhost & reload apache
  • Add "127.0.0.1 prestashop.fr" on your /etc/hosts file
  • Download last version of prestashop and install it on your web root directory (chown with the ftp user)

If you choose option "-c import ", you'll be asked your FTP host:login:pwd and it will download all available files You must set a dump file of your mysql database, so it will install it with the previously created mysql user

Here is the Generated VHOST content:

<VirtualHost *:80>
    ServerName prestashop.fr
    ServerAlias  www.prestashop.fr prestashop.fr www.prestashop.com prestashop.com www.prestashop.tk prestashop.tk
    DocumentRoot /var/www/myprojects/prestashop.fr
    
    ErrorLog /var/log/apache2/myprojects/prestashop.fr/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/myprojects/prestashop.fr/access.log combined
</VirtualHost>

#Requirements

  • proftpd => apt-get install proftpd
  • logrotate => apt-get install logrotate
  • Lamp Basics (Apache, MySql, Php)

#Todo

  • fix owncloud data directory right?
  • Add Local Cache (like composer's cache => .composer path on home directory)
  • Add others web project content:
    Cloud opensource project (owncloud or seafile...)
  • Fix Linux compatibility issues (apache home directory, log change...)
  • Add Nginx feature (asked by Melvyn)
  • Check /etc/hosts content before updating
  • Vhost BackUp commands
  • Add docker & configure it to a real project isolation (security, light backup...)
  • Study capifony integration (asked by rocky)
  • Publish a video & a blog article to present some real sample

shellvhostmanager's People

Contributors

ousamabenyounes avatar sebastienjardin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.