Code Monkey home page Code Monkey logo

xampp-vhost-creator's Introduction

#Batch Script: XAMPP Virtual Host Creator

This is a small script that facilitates the configuration of virtual hostings in xamp on windows.

##Initial configuration

###Config.ini All confgurations will be saved in the Config.ini file in the same folder as the script.

If this file does not exist, the script will try to create it dynamically.

###Script variables The first time the script is run, it will attempts to locate the configuration file to load the initial settings.

If not found it will try to create it dynamically with the help of the user.

  1. XAMPPDIR: The installation path of Xampp | Defautl: C:\xammp
  2. BASEURL: The document root for Xampp | Default: C:\xammp\htdocs\
  3. PREFIX: The prefix for the virtual host domain | Defualt: dev
  4. SUFFIX: The suffix for the virtual host domain | Defualt: local

##How to use When executed the script prompts the user to complete two values.

  1. Domain name: [prefix][domain][local]
    Ex.: For the domain dev.mysite.local, just enter the text mysite.

  2. Path to site root (relative to C:\mysitesfolder).

  3. The script will ask the user to confirm the values.

  4. And it will save the all the configurations in the appropriate files.

  • C:\Windows\System32\drivers\etc\hosts
  • C:\xampp\apache\conf\extra\httpd-vhosts.conf
  1. Now you just have to restart apache for the changes to take effect.

##Notes This is an example of the code generated by the script:

  1. Domain: dev.mysite.local

  2. Virtual Host:

   ###leandrogarcia###
   <VirtualHost *>
       DocumentRoot "C:\xampp\htdocs\mysitefiles\"
       ServerName dev.mysite.local
       <Directory "C:\xampp\htdocs\mysitefiles\">
           Order allow,deny
           Allow from all
       </Directory>
   </VirtualHost>

xampp-vhost-creator's People

Contributors

lukas238 avatar

Watchers

James Cloos 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.