Giter Club home page Giter Club logo

deploy_php's Introduction

deploy_php

This scripts that I use for life with local projects

Overview

This Bash script facilitates the creation and deletion of projects along with configuring Apache settings and MySQL databases for a development environment.

Requirements

Ensure that the following utilities are installed before executing the script:

* git
* openssl
* sudo
* systemctl
* mysql
* service
* a2ensite
* a2dissite

Before usinf you need to setup the script.

Usage

$ ./deploy_project.sh project_name action [git_repo]

Examples

Create a project:

$ ./deploy_project.sh create my_project_name https://github.com/username/my_project.git

Delete a project:

$ ./deploy_project.sh delete my_project_name

Arguments

* project_name: The name of the project.
* action: The action to perform, either create or delete.
* git_repo (optional): The Git repository URL (for SSH project creation).

Configuration

* MySQL: Ensure that the MYSQL_USER and MYSQL_PASSWORD variables are correctly configured in the script.
* Apache: Adjust the APACHE_SERVICE, SITES_AVAILABLE, and ADDRESS_SUFFIX variables as per your Apache configuration.
* Project Root Directory: Modify the PROJECTS_ROOT variable to define the root directory for your projects.

Functionality

Create Action:

* Sets up MySQL database and user.
* Clones the project from Git repository (if provided) and configures Apache settings (add VirtualHost and add record to hosts file).
* Provides instructions and paths for the created project.

Delete Action:

* Removes project-related directories and remove VirtualHost Apache settings.
* Deletes the MySQL database and associated database user.

Note

* The script checks for the necessary utilities and prerequisites before execution.
* Modify the script variables to align with your system configuration before usage.

deploy_php's People

Contributors

rnr1721 avatar

Watchers

 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.