From acfed0936f7ab402b2dfe9a93a95a758bdf49acb Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 17:17:53 -0700 Subject: [PATCH 01/17] Added some properties to the vagrant file --- Vagrantfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 4c71c94..7bdeb49 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,3 +1,11 @@ Vagrant.configure(2) do |config| + + #Define the ubuntu box config.vm.box = "ubuntu/trusty64" + + # Name the Vagrant instance + config.vm.define "CodeAndCoffeeVagrant" + + # Run bootstrap script + config.vm.provision :shell, path: "bootstrap.sh", privileged: false end From 5d46cfe4d8b22e1fd6768d36ff0281ee62c49d37 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 17:19:18 -0700 Subject: [PATCH 02/17] Added an old boot strap script Going to be optimized for just jekyll for now --- bootstrap.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..743869b --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +#Remove Non-interactive .bashrc lines +sh /vagrant/BaseVagrant/interactiveBash.sh + +#Update The Distro +sudo apt-get update + +#Download things for Npm and Ruby(Compass and things) +sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim apache2 + +# Set Up our apache +sh /vagrant/BaseVagrant/apacheVagrant.sh + +#Install NVM (Node Version Manager) +curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | sh +source /home/vagrant/.bashrc + +#Install Node (Latest LTS on 4/23/16) +nvm install 4.4.3 +nvm use 4.4.3 +node -v +nvm alias default 4.4.3 + +#Install npm without sudo +curl https://raw.githubusercontent.com/glenpike/npm-g_nosudo/master/npm-g-nosudo.sh | sh < /vagrant/BaseVagrant/npmNoSudoInput.txt +source /home/vagrant/.bashrc + +#Install RBEnv +cd +git clone git://github.com/sstephenson/rbenv.git .rbenv +echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc +echo 'eval "$(rbenv init -)"' >> ~/.bashrc +git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build +echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc +source /home/vagrant/.bashrc + +#Use RBEnv To install Ruby (Latest on 4/23/16) +rbenv install -v 2.3.0 +rbenv global 2.3.0 + +#ensure it installed +ruby -v + +#ruby gem tweaking +echo "gem: --no-document" > ~/.gemrc +gem install bundler + +#Install Rails +gem install rails +rbenv rehash +rails -v + +#INstall compass +gem install compass +rbenv rehash + +#Install Jekyll +gem install jekyll +rbenv rehash + +#Install stuff with npm +npm install -g npm +npm install --global yo --unsafe-perm +npm install --global bower grunt-cli ionic express +yo --version +bower --version +grunt --version + +#Add my personal preferences +sh /vagrant/BaseVagrant/personalPrefs.sh +source /home/vagrant/.bashrc + +#Finished! From 105f9cb3beba4dd8a55667cadd2cf6592d558566 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 17:24:17 -0700 Subject: [PATCH 03/17] Added some awesome/fun ubuntu personalization --- bootstrap.sh | 11 ++++--- issue.net | 47 ++++++++++++++++++++++++++++ sshd_config | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 issue.net create mode 100644 sshd_config diff --git a/bootstrap.sh b/bootstrap.sh index 743869b..ee05b7f 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash #Remove Non-interactive .bashrc lines -sh /vagrant/BaseVagrant/interactiveBash.sh +echo "Modifying .bashrc to allow edits" +sed '5,10d;' /home/vagrant/.bashrc > /home/vagrant/.bashrcNew +mv /home/vagrant/.bashrcNew /home/vagrant/.bashrc #Update The Distro sudo apt-get update @@ -67,8 +69,9 @@ yo --version bower --version grunt --version -#Add my personal preferences -sh /vagrant/BaseVagrant/personalPrefs.sh -source /home/vagrant/.bashrc +#Add our awesome ubuntu banner +sudo cp /vagrant/sshd_config /etc/ssh/sshd_config +sudo cp /vagrant/issue.net /etc/issue.net +sudo cp /vagrant/issue.net /etc/motd #Finished! diff --git a/issue.net b/issue.net new file mode 100644 index 0000000..2429808 --- /dev/null +++ b/issue.net @@ -0,0 +1,47 @@ + x0c. + .:OO. + xk + xk + .lOk. + 'ox' 'oOOl. + ;xx:. .dkc. + dNl 'XO. + .Xd dW; + .KO. lWo + ,kO:. ,oxdl:,'... + .oOOxl;. .,codxkOOOd' + .';ldxd' .;xOc + ,O0, :X; + .00. cX; + .00. 'xKc + .o0x' .,lk0: + .lkxc. .;oddddl:' + xO. 'o0Oo,. + 'N; .kOc. + xO' kd + oXx. kx + .ckdc',OO: + 'lxl.;x: + .oxxxkkkkkkkOOOOOOO0000000000KKKKKKKKKKKKKKKK00' + ,XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMl ':cc:,. + ;NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOlOXMMMWMMWKd. + cWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWk:....;oKMWk. + lMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK, .OMMO + oMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd cMMX + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM0. kMM0 + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMXd,. .'cOMW0, + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNWMMNKKNMMMXc + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMc.:oxkkxoc,. + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM; + oMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM; + :WMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW' + .KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK. + xMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd + ,WMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN, + lWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNc + cXWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWx. + ....................................... +.:dOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOk; + .lKMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNc + 'ckXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNO, + .:xKXXXXNNNNNNNNNWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMMWWWWNXK0kdc' diff --git a/sshd_config b/sshd_config new file mode 100644 index 0000000..35536aa --- /dev/null +++ b/sshd_config @@ -0,0 +1,88 @@ +# Package generated configuration file +# See the sshd_config(5) manpage for details + +# What ports, IPs and protocols we listen for +Port 22 +# Use these options to restrict which interfaces/protocols sshd will bind to +#ListenAddress :: +#ListenAddress 0.0.0.0 +Protocol 2 +# HostKeys for protocol version 2 +HostKey /etc/ssh/ssh_host_rsa_key +HostKey /etc/ssh/ssh_host_dsa_key +HostKey /etc/ssh/ssh_host_ecdsa_key +HostKey /etc/ssh/ssh_host_ed25519_key +#Privilege Separation is turned on for security +UsePrivilegeSeparation yes + +# Lifetime and size of ephemeral version 1 server key +KeyRegenerationInterval 3600 +ServerKeyBits 1024 + +# Logging +SyslogFacility AUTH +LogLevel INFO + +# Authentication: +LoginGraceTime 120 +PermitRootLogin without-password +StrictModes yes + +RSAAuthentication yes +PubkeyAuthentication yes +#AuthorizedKeysFile %h/.ssh/authorized_keys + +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes +# For this to work you will also need host keys in /etc/ssh_known_hosts +RhostsRSAAuthentication no +# similar for protocol version 2 +HostbasedAuthentication no +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication +#IgnoreUserKnownHosts yes + +# To enable empty passwords, change to yes (NOT RECOMMENDED) +PermitEmptyPasswords no + +# Change to yes to enable challenge-response passwords (beware issues with +# some PAM modules and threads) +ChallengeResponseAuthentication no + +# Change to no to disable tunnelled clear text passwords +PasswordAuthentication yes + +# Kerberos options +#KerberosAuthentication no +#KerberosGetAFSToken no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd no +PrintLastLog yes +TCPKeepAlive yes +#UseLogin no + +#MaxStartups 10:30:60 +Banner /etc/issue.net + +# Allow client to pass locale environment variables +AcceptEnv LANG LC_* + +Subsystem sftp /usr/lib/openssh/sftp-server + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +UsePAM yes From 4d6c3c2dec4014202437a2f75bfbacdb1d3bcfb8 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 17:31:45 -0700 Subject: [PATCH 04/17] Remove Node stuff Since we are simply focused on jekyll currently. Now testing the box --- bootstrap.sh | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index ee05b7f..8109734 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,5 +1,13 @@ #!/usr/bin/env bash +#Welcome the user +echo "" +echo "" +echo "Welcome to the Code And Coffee Long Beach vagrant!" +echo "We are now provisioning the vagrant box..." +echo "" +echo "" + #Remove Non-interactive .bashrc lines echo "Modifying .bashrc to allow edits" sed '5,10d;' /home/vagrant/.bashrc > /home/vagrant/.bashrcNew @@ -9,24 +17,7 @@ mv /home/vagrant/.bashrcNew /home/vagrant/.bashrc sudo apt-get update #Download things for Npm and Ruby(Compass and things) -sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim apache2 - -# Set Up our apache -sh /vagrant/BaseVagrant/apacheVagrant.sh - -#Install NVM (Node Version Manager) -curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | sh -source /home/vagrant/.bashrc - -#Install Node (Latest LTS on 4/23/16) -nvm install 4.4.3 -nvm use 4.4.3 -node -v -nvm alias default 4.4.3 - -#Install npm without sudo -curl https://raw.githubusercontent.com/glenpike/npm-g_nosudo/master/npm-g-nosudo.sh | sh < /vagrant/BaseVagrant/npmNoSudoInput.txt -source /home/vagrant/.bashrc +sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim #Install RBEnv cd @@ -61,14 +52,6 @@ rbenv rehash gem install jekyll rbenv rehash -#Install stuff with npm -npm install -g npm -npm install --global yo --unsafe-perm -npm install --global bower grunt-cli ionic express -yo --version -bower --version -grunt --version - #Add our awesome ubuntu banner sudo cp /vagrant/sshd_config /etc/ssh/sshd_config sudo cp /vagrant/issue.net /etc/issue.net From efa55af8e4baa81f13bcbeda71479c4631f5475a Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 17:33:04 -0700 Subject: [PATCH 05/17] Forwarded ports for the vagrant file That way we can access the vagrant when serving jekyll --- Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 7bdeb49..034c7d8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,6 +6,9 @@ Vagrant.configure(2) do |config| # Name the Vagrant instance config.vm.define "CodeAndCoffeeVagrant" + # Forward our ports + config.vm.network "forwarded_port", guest: 80, host: 8080 + # Run bootstrap script config.vm.provision :shell, path: "bootstrap.sh", privileged: false end From caf0c94d94d983bd20a9fcedaa43719be0e6d63f Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 18:50:56 -0700 Subject: [PATCH 06/17] Added support for apache Added files to support apache and things --- 000-default.conf | 31 +++++++ apache2.conf | 227 +++++++++++++++++++++++++++++++++++++++++++++++ bootstrap.sh | 30 ++++++- dir.conf | 5 ++ html/README | 3 + 5 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 000-default.conf create mode 100644 apache2.conf create mode 100644 dir.conf create mode 100644 html/README diff --git a/000-default.conf b/000-default.conf new file mode 100644 index 0000000..d764e69 --- /dev/null +++ b/000-default.conf @@ -0,0 +1,31 @@ + + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /vagrant/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/apache2.conf b/apache2.conf new file mode 100644 index 0000000..e7707d8 --- /dev/null +++ b/apache2.conf @@ -0,0 +1,227 @@ +# This is the main Apache server configuration file. It contains the +# configuration directives that give the server its instructions. +# See http://httpd.apache.org/docs/2.4/ for detailed information about +# the directives and /usr/share/doc/apache2/README.Debian about Debian specific +# hints. +# +# +# Summary of how the Apache 2 configuration works in Debian: +# The Apache 2 web server configuration in Debian is quite different to +# upstream's suggested way to configure the web server. This is because Debian's +# default Apache2 installation attempts to make adding and removing modules, +# virtual hosts, and extra configuration directives as flexible as possible, in +# order to make automating the changes and administering the server as easy as +# possible. + +# It is split into several files forming the configuration hierarchy outlined +# below, all located in the /etc/apache2/ directory: +# +# /etc/apache2/ +# |-- apache2.conf +# | `-- ports.conf +# |-- mods-enabled +# | |-- *.load +# | `-- *.conf +# |-- conf-enabled +# | `-- *.conf +# `-- sites-enabled +# `-- *.conf +# +# +# * apache2.conf is the main configuration file (this file). It puts the pieces +# together by including all remaining configuration files when starting up the +# web server. +# +# * ports.conf is always included from the main configuration file. It is +# supposed to determine listening ports for incoming connections which can be +# customized anytime. +# +# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ +# directories contain particular configuration snippets which manage modules, +# global configuration fragments, or virtual host configurations, +# respectively. +# +# They are activated by symlinking available configuration files from their +# respective *-available/ counterparts. These should be managed by using our +# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See +# their respective man pages for detailed information. +# +# * The binary is called apache2. Due to the use of environment variables, in +# the default configuration, apache2 needs to be started/stopped with +# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not +# work with the default configuration. + + +# Global configuration +# + +# +# ServerRoot: The top of the directory tree under which the server's +# configuration, error, and log files are kept. +# +# NOTE! If you intend to place this on an NFS (or otherwise network) +# mounted filesystem then please read the Mutex documentation (available +# at ); +# you will save yourself a lot of trouble. +# +# Do NOT add a slash at the end of the directory path. +# +#ServerRoot "/etc/apache2" + +# +# The accept serialization lock file MUST BE STORED ON A LOCAL DISK. +# +Mutex file:${APACHE_LOCK_DIR} default + +# +# PidFile: The file in which the server should record its process +# identification number when it starts. +# This needs to be set in /etc/apache2/envvars +# +PidFile ${APACHE_PID_FILE} + +# +# Timeout: The number of seconds before receives and sends time out. +# +Timeout 300 + +# +# KeepAlive: Whether or not to allow persistent connections (more than +# one request per connection). Set to "Off" to deactivate. +# +KeepAlive On + +# +# MaxKeepAliveRequests: The maximum number of requests to allow +# during a persistent connection. Set to 0 to allow an unlimited amount. +# We recommend you leave this number high, for maximum performance. +# +MaxKeepAliveRequests 100 + +# +# KeepAliveTimeout: Number of seconds to wait for the next request from the +# same client on the same connection. +# +KeepAliveTimeout 5 + + +# These need to be set in /etc/apache2/envvars +User ${APACHE_RUN_USER} +Group ${APACHE_RUN_GROUP} + +# +# HostnameLookups: Log the names of clients or just their IP addresses +# e.g., www.apache.org (on) or 204.62.129.132 (off). +# The default is off because it'd be overall better for the net if people +# had to knowingly turn this feature on, since enabling it means that +# each client request will result in AT LEAST one lookup request to the +# nameserver. +# +HostnameLookups Off + +# ErrorLog: The location of the error log file. +# If you do not specify an ErrorLog directive within a +# container, error messages relating to that virtual host will be +# logged here. If you *do* define an error logfile for a +# container, that host's errors will be logged there and not here. +# +ErrorLog ${APACHE_LOG_DIR}/error.log + +# +# LogLevel: Control the severity of messages logged to the error_log. +# Available values: trace8, ..., trace1, debug, info, notice, warn, +# error, crit, alert, emerg. +# It is also possible to configure the log level for particular modules, e.g. +# "LogLevel info ssl:warn" +# +LogLevel warn + +# Include module configuration: +IncludeOptional mods-enabled/*.load +IncludeOptional mods-enabled/*.conf + +# Include list of ports to listen on +Include ports.conf + + +# Sets the default security model of the Apache2 HTTPD server. It does +# not allow access to the root filesystem outside of /usr/share and /var/www. +# The former is used by web applications packaged in Debian, +# the latter may be used for local directories served by the web server. If +# your system is serving content from a sub-directory in /srv you must allow +# access here, or in any related virtual host. + + Options FollowSymLinks + AllowOverride None + Require all denied + + + + AllowOverride None + Require all granted + + + + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + +# +# Options Indexes FollowSymLinks +# AllowOverride None +# Require all granted +# + + + + +# AccessFileName: The name of the file to look for in each directory +# for additional configuration directives. See also the AllowOverride +# directive. +# +AccessFileName .htaccess + +# +# The following lines prevent .htaccess and .htpasswd files from being +# viewed by Web clients. +# + + Require all denied + + + +# +# The following directives define some format nicknames for use with +# a CustomLog directive. +# +# These deviate from the Common Log Format definitions in that they use %O +# (the actual bytes sent including headers) instead of %b (the size of the +# requested file), because the latter makes it impossible to detect partial +# requests. +# +# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended. +# Use mod_remoteip instead. +# +LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined +LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined +LogFormat "%h %l %u %t \"%r\" %>s %O" common +LogFormat "%{Referer}i -> %U" referer +LogFormat "%{User-agent}i" agent + +# Include of directories ignores editors' and dpkg's backup files, +# see README.Debian for details. + +# Include generic snippets of statements +IncludeOptional conf-enabled/*.conf + +# Include the virtual host configurations: +IncludeOptional sites-enabled/*.conf + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/bootstrap.sh b/bootstrap.sh index 8109734..44f2db7 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -17,9 +17,35 @@ mv /home/vagrant/.bashrcNew /home/vagrant/.bashrc sudo apt-get update #Download things for Npm and Ruby(Compass and things) -sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim +sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim apache2 -#Install RBEnv +#Install apache2 + +# Replace apache dir.conf, enable apache php +sudo cp /vagrant/dir.conf /etc/apache2/mods-enabled/dir.conf + +#Restart apache +sudo service apache2 restart + +#Set our document root so we can access it +sudo cp /vagrant/000-default.conf /etc/apache2/sites-available/000-default.conf + +#Restart apache +sudo service apache2 restart + +#Allow .htaccess overrides +sudo cp /vagrant/apache2.conf /etc/apache2/apache2.conf +sudo a2enmod rewrite +sudo apache2ctl configtest + +#Own the html directory by www-data +sudo chown -R vagrant:www-data /vagrant/html +sudo chmod -R 755 /vagrant/html + +#Restart apache for the permissions change +sudo service apache2 restart + +#Install RbEnv cd git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc diff --git a/dir.conf b/dir.conf new file mode 100644 index 0000000..7acce03 --- /dev/null +++ b/dir.conf @@ -0,0 +1,5 @@ + + DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/html/README b/html/README new file mode 100644 index 0000000..f6b86d8 --- /dev/null +++ b/html/README @@ -0,0 +1,3 @@ +# This folder is used by apache + +Place your projects/files you would like apache to serve here From 6e8104e73ab23de57457dee82124c628d2fe47bf Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 19:20:18 -0700 Subject: [PATCH 07/17] Added .gitignore, and html directory for apache Also, added a nice little welcome to banner, and added bundle gem to be installed --- .gitignore | 1 + bootstrap.sh | 4 ++++ codeandcoffeelb.github.io | 1 + html/README | 0 issue.net | 5 ++++- 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 160000 codeandcoffeelb.github.io mode change 100644 => 100755 html/README diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8000dd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vagrant diff --git a/bootstrap.sh b/bootstrap.sh index 44f2db7..a0fa9dd 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -78,6 +78,10 @@ rbenv rehash gem install jekyll rbenv rehash +#Install Bundlrer +gem install bundle +rbenv rehash + #Add our awesome ubuntu banner sudo cp /vagrant/sshd_config /etc/ssh/sshd_config sudo cp /vagrant/issue.net /etc/issue.net diff --git a/codeandcoffeelb.github.io b/codeandcoffeelb.github.io new file mode 160000 index 0000000..2eebf1e --- /dev/null +++ b/codeandcoffeelb.github.io @@ -0,0 +1 @@ +Subproject commit 2eebf1e9f856c5b8cb9f0cdbb71177df960924e7 diff --git a/html/README b/html/README old mode 100644 new mode 100755 diff --git a/issue.net b/issue.net index 2429808..971ed94 100644 --- a/issue.net +++ b/issue.net @@ -1,4 +1,7 @@ - x0c. + +Welcome to the Code And Coffee Vagrant Box! + + x0c. .:OO. xk xk From 84e6738551e6f647adf28bedb6935151717ed8ec Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 19:27:29 -0700 Subject: [PATCH 08/17] Updated the gitignore, and fixed a spelling mistake --- .gitignore | 7 +++++++ bootstrap.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8000dd9..4e19934 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ +# Ignore the .vagrant folder .vagrant + +#Ignore all cloned repos/folders +*/ + +#Dont ignore the html folder/readme +!/html/README diff --git a/bootstrap.sh b/bootstrap.sh index a0fa9dd..f2867e7 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -78,7 +78,7 @@ rbenv rehash gem install jekyll rbenv rehash -#Install Bundlrer +#Install Bundler gem install bundle rbenv rehash From bda73b3be9c2de3237e5cf92275dbfc2b24b33e1 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 19:34:55 -0700 Subject: [PATCH 09/17] Added node/angular support Node i required by the bundles in the jekyll site, so I added node support --- bootstrap.sh | 36 ++++++++++++++++++++++++++++++++---- codeandcoffeelb.github.io | 1 - issue.net | 2 +- npmNoSudoInput.txt | 2 ++ 4 files changed, 35 insertions(+), 6 deletions(-) delete mode 160000 codeandcoffeelb.github.io create mode 100644 npmNoSudoInput.txt diff --git a/bootstrap.sh b/bootstrap.sh index f2867e7..f8bbb65 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash #Welcome the user -echo "" -echo "" +echo "\n" +echo "\n" echo "Welcome to the Code And Coffee Long Beach vagrant!" echo "We are now provisioning the vagrant box..." -echo "" -echo "" +echo "\n" +echo "\n" #Remove Non-interactive .bashrc lines echo "Modifying .bashrc to allow edits" @@ -45,6 +45,20 @@ sudo chmod -R 755 /vagrant/html #Restart apache for the permissions change sudo service apache2 restart +#Install NVM (Node Version Manager) +curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | sh +source /home/vagrant/.bashrc + +#Install Node (Latest LTS on 4/23/16) +nvm install 4.4.3 +nvm use 4.4.3 +node -v +nvm alias default 4.4.3 + +#Install npm without sudo +curl https://raw.githubusercontent.com/glenpike/npm-g_nosudo/master/npm-g-nosudo.sh | sh < /vagrant/npmNoSudoInput.txt +source /home/vagrant/.bashrc + #Install RbEnv cd git clone git://github.com/sstephenson/rbenv.git .rbenv @@ -82,9 +96,23 @@ rbenv rehash gem install bundle rbenv rehash +#Update npm, Install grunt and bower with npm +npm install -g npm +npm install --global bower grunt-cli +bower --version +grunt --version + #Add our awesome ubuntu banner sudo cp /vagrant/sshd_config /etc/ssh/sshd_config sudo cp /vagrant/issue.net /etc/issue.net sudo cp /vagrant/issue.net /etc/motd #Finished! + +#Salutations to the user +echo "\n" +echo "\n" +echo "Thank you for using the Code And Coffee Long Beach Vagrant!" +echo "Have a nice day!" +echo "\n" +echo "\n" diff --git a/codeandcoffeelb.github.io b/codeandcoffeelb.github.io deleted file mode 160000 index 2eebf1e..0000000 --- a/codeandcoffeelb.github.io +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2eebf1e9f856c5b8cb9f0cdbb71177df960924e7 diff --git a/issue.net b/issue.net index 971ed94..a8cf823 100644 --- a/issue.net +++ b/issue.net @@ -1,5 +1,5 @@ -Welcome to the Code And Coffee Vagrant Box! +Welcome to the Code And Coffee Long Beach Vagrant Box! x0c. .:OO. diff --git a/npmNoSudoInput.txt b/npmNoSudoInput.txt new file mode 100644 index 0000000..8cb8bae --- /dev/null +++ b/npmNoSudoInput.txt @@ -0,0 +1,2 @@ + +y From 5bd385de7afb47877bd4316467767dc9b087de27 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Tue, 3 May 2016 20:41:15 -0700 Subject: [PATCH 10/17] Removed echo new lines they didnt work :( --- bootstrap.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index f8bbb65..365a9f6 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,12 +1,8 @@ #!/usr/bin/env bash #Welcome the user -echo "\n" -echo "\n" echo "Welcome to the Code And Coffee Long Beach vagrant!" echo "We are now provisioning the vagrant box..." -echo "\n" -echo "\n" #Remove Non-interactive .bashrc lines echo "Modifying .bashrc to allow edits" @@ -110,9 +106,5 @@ sudo cp /vagrant/issue.net /etc/motd #Finished! #Salutations to the user -echo "\n" -echo "\n" echo "Thank you for using the Code And Coffee Long Beach Vagrant!" echo "Have a nice day!" -echo "\n" -echo "\n" From 9823da76530e030b342625af830e69cef8881af6 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:17:25 -0700 Subject: [PATCH 11/17] Added a vagrant config folder to better organize the repo --- .gitignore | 3 ++- Vagrantfile | 2 ++ bootstrap.sh | 12 ++++++------ 000-default.conf => vagrantConfig/000-default.conf | 0 apache2.conf => vagrantConfig/apache2.conf | 0 dir.conf => vagrantConfig/dir.conf | 0 issue.net => vagrantConfig/issue.net | 0 .../npmNoSudoInput.txt | 0 sshd_config => vagrantConfig/sshd_config | 0 9 files changed, 10 insertions(+), 7 deletions(-) rename 000-default.conf => vagrantConfig/000-default.conf (100%) rename apache2.conf => vagrantConfig/apache2.conf (100%) rename dir.conf => vagrantConfig/dir.conf (100%) rename issue.net => vagrantConfig/issue.net (100%) rename npmNoSudoInput.txt => vagrantConfig/npmNoSudoInput.txt (100%) rename sshd_config => vagrantConfig/sshd_config (100%) diff --git a/.gitignore b/.gitignore index 4e19934..0400730 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ #Ignore all cloned repos/folders */ -#Dont ignore the html folder/readme +#Dont ignore the html folder/readme or vagrant config files !/html/README +!/vagrantConfig diff --git a/Vagrantfile b/Vagrantfile index 034c7d8..70d7691 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,7 +7,9 @@ Vagrant.configure(2) do |config| config.vm.define "CodeAndCoffeeVagrant" # Forward our ports + # 80 for apache, 4000 for jekyll config.vm.network "forwarded_port", guest: 80, host: 8080 + config.vm.network "forwarded_port", guest: 4000, host: 4000 # Run bootstrap script config.vm.provision :shell, path: "bootstrap.sh", privileged: false diff --git a/bootstrap.sh b/bootstrap.sh index 365a9f6..87926d5 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -18,19 +18,19 @@ sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev #Install apache2 # Replace apache dir.conf, enable apache php -sudo cp /vagrant/dir.conf /etc/apache2/mods-enabled/dir.conf +sudo cp /vagrant/vagrantConfig/dir.conf /etc/apache2/mods-enabled/dir.conf #Restart apache sudo service apache2 restart #Set our document root so we can access it -sudo cp /vagrant/000-default.conf /etc/apache2/sites-available/000-default.conf +sudo cp /vagrant/vagrantConfig/000-default.conf /etc/apache2/sites-available/000-default.conf #Restart apache sudo service apache2 restart #Allow .htaccess overrides -sudo cp /vagrant/apache2.conf /etc/apache2/apache2.conf +sudo cp /vagrant/vagrantConfig/apache2.conf /etc/apache2/apache2.conf sudo a2enmod rewrite sudo apache2ctl configtest @@ -99,9 +99,9 @@ bower --version grunt --version #Add our awesome ubuntu banner -sudo cp /vagrant/sshd_config /etc/ssh/sshd_config -sudo cp /vagrant/issue.net /etc/issue.net -sudo cp /vagrant/issue.net /etc/motd +sudo cp /vagrant/vagrantConfig/sshd_config /etc/ssh/sshd_config +sudo cp /vagrant/vagrantConfig/issue.net /etc/issue.net +sudo cp /vagrant/vagrantConfig/issue.net /etc/motd #Finished! diff --git a/000-default.conf b/vagrantConfig/000-default.conf similarity index 100% rename from 000-default.conf rename to vagrantConfig/000-default.conf diff --git a/apache2.conf b/vagrantConfig/apache2.conf similarity index 100% rename from apache2.conf rename to vagrantConfig/apache2.conf diff --git a/dir.conf b/vagrantConfig/dir.conf similarity index 100% rename from dir.conf rename to vagrantConfig/dir.conf diff --git a/issue.net b/vagrantConfig/issue.net similarity index 100% rename from issue.net rename to vagrantConfig/issue.net diff --git a/npmNoSudoInput.txt b/vagrantConfig/npmNoSudoInput.txt similarity index 100% rename from npmNoSudoInput.txt rename to vagrantConfig/npmNoSudoInput.txt diff --git a/sshd_config b/vagrantConfig/sshd_config similarity index 100% rename from sshd_config rename to vagrantConfig/sshd_config From 2d5c48d780931341d4923b4c69ec6f3953d185f1 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:18:49 -0700 Subject: [PATCH 12/17] Added a readme to the vagrant config folder to make lives easier --- vagrantConfig/README | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 vagrantConfig/README diff --git a/vagrantConfig/README b/vagrantConfig/README new file mode 100644 index 0000000..f37f75e --- /dev/null +++ b/vagrantConfig/README @@ -0,0 +1,5 @@ +# This folder is used by Vagrant for provisioning + +Here you will find files that are preconfigured to work with the code and coffee vagrant, + +Such as apache files, as well as some files to enable the ssh banner From 7df0f8ee58bcd1c2dca4658b794196b935a35163 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:26:58 -0700 Subject: [PATCH 13/17] Added a gif to the readme to look cool! --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d357673..53bdb17 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# coffeemaker +# CoffeeMaker + +![CofeeMaker Vagrant .gif](https://cloud.githubusercontent.com/assets/1448289/15005253/e4156dce-1176-11e6-84a6-8aff8439ee97.gif) + Vagrant Box with all tools needed to work on C&&C projects From e3543e0f3c6e397aaa32bd53b5c5f0be59dd8472 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:27:50 -0700 Subject: [PATCH 14/17] Added a short description of tools included --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 53bdb17..a8da960 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ ![CofeeMaker Vagrant .gif](https://cloud.githubusercontent.com/assets/1448289/15005253/e4156dce-1176-11e6-84a6-8aff8439ee97.gif) Vagrant Box with all tools needed to work on C&&C projects + +This includes tools such as NodeJS, NPM, Ruby, and Jekyll From 5f724515337ebd4f3abb0c0a236a367f0cac8664 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:29:15 -0700 Subject: [PATCH 15/17] Added .md to readme to make them markdown --- html/README | 3 --- vagrantConfig/{README => README.md} | 0 2 files changed, 3 deletions(-) delete mode 100755 html/README rename vagrantConfig/{README => README.md} (100%) diff --git a/html/README b/html/README deleted file mode 100755 index f6b86d8..0000000 --- a/html/README +++ /dev/null @@ -1,3 +0,0 @@ -# This folder is used by apache - -Place your projects/files you would like apache to serve here diff --git a/vagrantConfig/README b/vagrantConfig/README.md similarity index 100% rename from vagrantConfig/README rename to vagrantConfig/README.md From e89584c93a7000c4126825000dc94b4a1ab7a6e4 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:30:03 -0700 Subject: [PATCH 16/17] Un gitignored-d the html folder --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0400730..4964689 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ */ #Dont ignore the html folder/readme or vagrant config files -!/html/README +!/html/README.md !/vagrantConfig From c5f49e168b765511e367b881f385162ec8af4332 Mon Sep 17 00:00:00 2001 From: Aaron Turner Date: Thu, 5 May 2016 19:32:21 -0700 Subject: [PATCH 17/17] Un-gitignored the html folder to be pushed up --- .gitignore | 2 +- html/README.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 html/README.md diff --git a/.gitignore b/.gitignore index 4964689..36ea98c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ */ #Dont ignore the html folder/readme or vagrant config files -!/html/README.md +!/html !/vagrantConfig diff --git a/html/README.md b/html/README.md new file mode 100755 index 0000000..f6b86d8 --- /dev/null +++ b/html/README.md @@ -0,0 +1,3 @@ +# This folder is used by apache + +Place your projects/files you would like apache to serve here