Coder Social home page Coder Social logo

adddomain's Introduction

NewSite Script alt text

Auto domain generate domain for apache2

====================================================

Copyright (C) 2013 Apinan Woratrakun All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Script create by Apinan Woratrakun Follow me on http://plus.noeplaza.org/profile/iamapinan, http://www.facebook.com/mrapinan

This script support on Debian server such as Ubuntu, debian, Linux Mint Debian Edition, and more. Create for a apache web server you must have to install apache2 on your server This script will automatic add a new domain to apache virtual hosts. and also create default web directory with index.html file. You can also edit this file if you want

Example.com (/etc/apache2/sites-available/www.example.com) This is virtual host example code.

<VirtualHost *>
        ServerAdmin [email protected]
        ServerName  www.example.com
        ServerAlias example.com

        #Indexes + Directory Root.
        DirectoryIndex index.html
        DocumentRoot /home/www/www.example.com/htdocs/

        # CGI Directory
        ScriptAlias /cgi-bin/ /home/www/www.example.com/cgi-bin/
        <Location /cgi-bin>
                Options +ExecCGI
        </Location>

        #Logfiles
        ErrorLog  /home/www/www.example.com/logs/error.log
        CustomLog /home/www/www.example.com/logs/access.log combined

</VirtualHost>

Example of use

 root:>./newsite.sh
 
 Get help by email: [email protected]
 Press Ctrl+C to terminate operation
=======================================
What user name to use as own:?
admin
Directory for site:?
example.org
=======================================
System will create directory for example.org
=======================================
Press [ENTER] to continue...
Creating directory...
Put new index.html file to home directory
Successfully...
========================================
Press [ENTER] to continue...
Adding domain to apache
Enabling site example.org.conf.
To activate the new configuration, you need to run:
  service apache2 reload
 * Restarting web server apache2                                                 [ OK ]
========================================================
Your domain directory is /home/admin/www/example.org/public_html/
Already to add your domain to apache web server
You can open web browser and type http://example.org to test it...
========================================================
Press [ENTER] to continue...

adddomain's People

Contributors

iamapinan avatar

Stargazers

 avatar  avatar

Watchers

 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.