Commit 35a442b6 authored by Brian Dukes's avatar Brian Dukes
Browse files

updated readme and added some needed files

parent 9d4126ae
# README #
This is Base Site 5
This is a tool for local development. This will allow you to sync projects from gitlab locally with ease.
### What is this repository for? ###
* Base Site
* 5.0.2
* Magento/Basesite/Wordpress
### How do I get set up? ###
* Copy /app/config/config.dist.inc.php to config.inc.php and edit with database credentials
* Make the following directories writable
* /app/design/content
* /app/modules
* /app/packages
* /cache
* /content
* /d3panel
* /media/files
* /media/images
* /media/uploads
* Run http://domain.com/d3panel/install.php to installer
1. Create a folder on your computer to serve as the server root, this will host a Magento, Basesite and Wordpress folder for those sites. Make a note of the server root location as that will be needed for the script.
It should look something like this /mnt/c/path/to/folder /mnt lets you access drives on your computer, /mnt/c being the c drive /mnt/d being the d drive so use that to set the path.
2. Start Menu-> Search for "Developer" and click on the Developer settings. Enable Developer Mode on the computer
3. Start Menu-> Search for "Features" and click on the turn windows features on or off. check the Windows subsystem for linux option and click ok
4. Restart Computer
5. Start Menu-> Search for "Bash" and click on it and follow instructions for install
--make note of your unix username and password as they will need to used later in the setup script
6. when install is done type exit
7. Start Menu-> Search for "Bash" and right click on it then Run as Administrator to open up the terminal
8. vim setup.sh to create the file then copy paste contents from setup.sh file included. update setup.sh
Line 2: set your unix username from step 5
Line 3: set your unix password from step 5
Line 4: set your email to generate ssh key (should be gitlab email)
Line 5: set your computer name (this comes after the @ in the terminal, for instance mine shows bdukes@DESKTOP-U526Q6KQ so my computer name is DESKTOP-U526Q6KQ)
Line 6: set your server root folder from step 1
9. copy ssh key output and paste it into into gitlab ssh keys so composer works
10. type exit and close out of bash
11. Start Menu-> "Bash" Right click on file and click on "Open file Location". right click on the file in the folder and click on properties.
Under Shortcut Tab -> Target enter "C:\Windows\System32\bash.exe -c ~/autostart.sh ~" (without the quotes)
Under Shortcut Tab -> click on Advanced button and check the box for run as administrator
This will make the bash file on your computer auto start apache/mysql when you open it and force it to open as administrator (so you dont have to right click on it each time)
### Common Problems ###
I had an issue when testing this on a virtual box install (could have been from being on that) where composer update wouldnt work on the ops project. If you get errors when viewing ops.dev try going to the ops folder and running composer update again. This was giving me content-length errors however after running it 2-3 times it started working.
### Who do I talk to? ###
* Brian Liccardo <brian@d3corp.com>
\ No newline at end of file
* Brian Dukes <briand@d3corp.com>
\ No newline at end of file
......@@ -4,60 +4,9 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "979d72cc63129e1e1ba5257d323b7c7d",
"content-hash": "d94ac0a7da77ee08cc41e22f7faebec0",
"hash": "7db85988aae0ef66412b3d225f64229b",
"content-hash": "797d3e8fb7c90b46905d345da52713c1",
"packages": [
{
"name": "gorkalaucirica/hipchat-v2-api-client",
"version": "dev-master",
"target-dir": "GorkaLaucirica/HipchatAPIv2Client",
"source": {
"type": "git",
"url": "https://github.com/gorkalaucirica/HipchatAPIv2Client.git",
"reference": "045521cd01aba26cdf304010bc3f66dc4f9fd37c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gorkalaucirica/HipchatAPIv2Client/zipball/045521cd01aba26cdf304010bc3f66dc4f9fd37c",
"reference": "045521cd01aba26cdf304010bc3f66dc4f9fd37c",
"shasum": ""
},
"require": {
"kriswallsmith/buzz": "0.10",
"php": ">=5.3.3"
},
"require-dev": {
"henrikbjorn/phpspec-code-coverage": "1.0.*@dev",
"phpspec/phpspec": "2.0.*@dev"
},
"type": "library",
"autoload": {
"psr-0": {
"GorkaLaucirica\\HipchatAPIv2Client": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gorka Laucirica",
"email": "gorka.lauzirika@gmail.com",
"homepage": "http://gorkalaucirica.net/"
}
],
"description": "Hipchat v2 API client",
"homepage": "https://github.com/gorkalaucirica/HipchatAPIv2Client",
"keywords": [
"api",
"client",
"hipchat",
"library",
"v2"
],
"time": "2016-04-30 11:45:31"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.2.2",
......@@ -229,54 +178,6 @@
],
"time": "2016-06-24 23:00:38"
},
{
"name": "kriswallsmith/buzz",
"version": "v0.10",
"source": {
"type": "git",
"url": "https://github.com/kriswallsmith/Buzz.git",
"reference": "759432d66387e3433d3b06cb6f773b97225b9b17"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kriswallsmith/Buzz/zipball/759432d66387e3433d3b06cb6f773b97225b9b17",
"reference": "759432d66387e3433d3b06cb6f773b97225b9b17",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"suggest": {
"ext-curl": "*"
},
"type": "library",
"autoload": {
"psr-0": {
"Buzz": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kris Wallsmith",
"email": "kris.wallsmith@gmail.com",
"homepage": "http://kriswallsmith.net/"
}
],
"description": "Lightweight HTTP client",
"homepage": "https://github.com/kriswallsmith/Buzz",
"keywords": [
"curl",
"http client"
],
"time": "2013-05-19 03:41:15"
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.4",
......@@ -594,8 +495,7 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"twig/twig": 20,
"gorkalaucirica/hipchat-v2-api-client": 20
"twig/twig": 20
},
"prefer-stable": false,
"prefer-lowest": false,
......
This diff is collapsed.
#!/bin/bash
user="bdukes"
pass="bdukes"
email="briand@d3corp.com"
compname="DESKTOP-U526Q6KQ"
webpath="/mnt/c/Server"
#SETUP HOSTS FILE
#THIS SYMLINKS THE UBUNTU HOSTS FILE TO THE WINDOWS ONE SO ONLY HAVE TO ADD 1 ENTRY
rm /etc/hosts
ln -s /mnt/c/Windows/System32/drivers/etc/hosts /etc/hosts
#ADD COMPUTER NAME AND LOCALHOST TO HOSTS FILE
printf "127.0.1.1 $compname\n" >> /etc/hosts
printf "127.0.0.1 localhost\n" >> /etc/hosts
#INSTALL PACKAGES
apt-get -y install apache2 mysql-server-5.6 php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-curl curl php5-cli git
#INSTALL COMPOSER
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
#ENABLE MOD REWRITE
a2enmod rewrite
#ADD SERVER ROOT DIRECTORY TO APACHE.CONF FILE
printf "<Directory $webpath>\n\tOptions Indexes FollowSymLinks\n\tAllowOverride All\n\tRequire all granted\n</Directory>\n" >> /etc/apache2/apache2.conf
#ADD APACHE.CONF VARS
printf "ServerName localhost\n" >> /etc/apache2/apache2.conf
printf "AcceptFilter http none\n" >> /etc/apache2/apache2.conf
#WSL FIX
mkdir -p /run/lock
#SET APACHE TO RUN AS YOUR USER, THAT WAY THE OPS TOOL CAN DO COMPOSER UPDATE AS YOU
sed -i "s/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=$user/g" /etc/apache2/envvars
sed -i "s/export APACHE_RUN_GROUP=www-data/export APACHE_RUN_GROUP=$user/g" /etc/apache2/envvars
#SET APACHE PERMISSIONS FROM USER CHANGE
chown $user.$user /var/lock/apache2
chown $user.$user /var/log/apache2
chown -R $user.$user /var/log/apache2
chown -R $user.$user /var/lib/php5
#MAKE SURE COMPOSER HAS PROPER PERMISSIONS
chown -R $user.$user .composer
rm /home/$user/.composer/config.json
#THIS IS HACKY BUT ALLOWS SUDO COMMANDS TO BE RUN IN PHP EXEC WITHOUT NEEDING INPUT FOR PASSWORD
mkdir ~/.sudopass
echo "$pass" > ~/.sudopass/sudopass.secret
chown -R $user.$user ~/.sudopass
#ALLOWS AUTOSTART.SH SCRIPT TO WORK
printf "# Allow apache2 and mysql to start without a sudo password\n%%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service apache2 *\n%%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service mysql *\n" >> /etc/sudoers
#AUTOSTART.SH SCRIPT
printf "#!/bin/bash\nsudo service mysql start\nsudo service apache2 start\ncd ~\nbash" > /home/$user/autostart.sh
chmod +x /home/$user/autostart.sh
sudo chown $user.$user /home/$user/autostart.sh
#CLONE OPS TOOL AND SETUP CONFIG NEEDED FOR IT
cd $webpath && git clone https://git.d3corp.com/d3briand/localops.git Ops
sudo -H -u $user bash -c "cd $webpath/Ops && composer update"
printf "127.0.0.1 ops.dev\n" >> /etc/hosts
printf "<VirtualHost ops.dev:80>\nDocumentRoot $webpath/Ops/web\n</VirtualHost>" > /etc/apache2/sites-available/ops.dev.conf
a2ensite ops.dev
#GENERATE SSH KEY
mkdir /home/$user/.ssh
chown -R $user.$user /home/$user/.ssh
ssh-keygen -f /home/$user/.ssh/id_rsa.pub -t rsa -C "$email"
echo "setup finished\n"
echo "please paste this key into gitlab so the server can sync with it: "
cat ~/.ssh/id_rsa.pub
#YAY WE HOPEFULLY HAVE A SERVER WORKING
\ No newline at end of file
!/bin/bash
user="bdukes"
pass="bdukes"
email="briand@d3corp.com"
compname="DESKTOP-U526Q6KQ"
apt-get -y install apache2 mysql-server-5.6 php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-curl curl php5-cli git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
a2enmod rewrite
rm /etc/hosts
ln -s /mnt/c/Windows/System32/drivers/etc/hosts /etc/hosts
printf "127.0.1.1 $compname\n" >> /etc/hosts
printf "127.0.0.1 localhost\n" >> /etc/hosts
printf "<Directory /mnt/w/>\n\tOptions Indexes FollowSymLinks\n\tAllowOverride All\n\tRequire all granted\n\t</Directory>" >> /etc/apache2/apache2.conf
printf "ServerName localhost\n" >> /etc/apache2/apache2.conf
printf "AcceptFilter http none\n" >> /etc/apache2/apache2.conf
mkdir -p /run/lock
sed -i 's/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=$user/g' /etc/apache2/envvars
sed -i 's/export APACHE_RUN_GROUP=www-data/export APACHE_RUN_GROUP=$user/g' /etc/apache2/envvars
sudo chown $user.$user /var/lock/apache2
sudo chown $user.$user /var/log/apache2
sudo chown -R $user.$user /var/log/apache2
sudo chown -R $user.$user /var/lib/php5/
ssh-keygen -t rsa -C "$email"
mkdir ~/.composer
sudo chown -R $user.$user .composer/
mkdir ~/.sudopass
echo "$pass" > ~/.sudopass/sudopass.secret
printf "# Allow apache2 and mysql to start without a sudo password\n%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service apache2 *\n%sudo ALL=(ALL) NOPASSWD: /usr/sbin/service mysql *\n" >> /etc/sudoers
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment