Bootstrap: Apache and PHP configuration. Some refactoring.

This commit is contained in:
Artem Sapegin 2012-10-26 17:55:57 +04:00
parent 0c43431131
commit 9d58ce5572
4 changed files with 27 additions and 23 deletions

View File

@ -12,25 +12,21 @@ Run `./bootstrap.sh` (or separate scripts in this folder) and make you some coff
## Scripts ## Scripts
### brew ### stuff
Installs Homebrew with some formulaes (Git, MySQL, Node.js, etc.). Installs Homebrew, Git, [git-extras](https://github.com/visionmedia/git-extras), [git-friendly](https://github.com/jamiew/git-friendly), Node.js, JSHint, Grunt, configures Apache, PHP, MySQL, etc.
### npm
Installs some NPM modules (JSHint, Grunt, etc.). Depends on `brew`.
### bash ### bash
Installs Bash 4 and registers it as a default shell. Depends on `brew`. Installs Bash 4 and registers it as a default shell. Needs Homebrew.
### consolas ### consolas
Installs Consolas font. Depends on `brew`. Installs Consolas font. Needs Homebrew.
### imgo ### imgo
Installs [imgo](https://github.com/imgo/imgo) CLI image optimizer. Depends on `brew`. Installs [imgo](https://github.com/imgo/imgo) CLI image optimizer. Needs Homebrew.
### osx ### osx

View File

@ -2,8 +2,7 @@
# New Mac bootstrap # New Mac bootstrap
. brew.sh . stuff.sh
. npm.sh
. bash.sh . bash.sh
. consolas.sh . consolas.sh
. imgo.sh . imgo.sh

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Installs Node.js and some NPM packages
brew install node
npm install -g grunt
npm install -g jshint
npm install -g bower

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Installs Homebrew with some formulaes # Installs Homebrew, Git, git-extras, git-friendly, Node.js, configures Apache, PHP, MySQL, etc.
# Setup Homebrew # Install Homebrew
command -v brew >/dev/null 2>&1 || ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" command -v brew >/dev/null 2>&1 || ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
# Make sure were using the latest Homebrew # Make sure were using the latest Homebrew
@ -32,9 +32,28 @@ unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
/usr/local/opt/mysql/bin/mysqladmin -u root password 'root' /usr/local/opt/mysql/bin/mysqladmin -u root password 'root'
# Apache: enable PHP, .htaccess files, virtual hosts and set it to run as current user
cd /etc/apache2
sudo cp httpd.conf httpd.conf.bak
sudo cp extra/httpd-vhosts.conf extra/httpd-vhosts.conf.bak
sudo sed -i '' "s^#\(LoadModule php5_module\)^\1^" httpd.conf
sudo sed -i '' "s^#\(Include /private/etc/apache2/extra/httpd-vhosts.conf\)^\1^" httpd.conf
sudo sed -i '' "s^<IfDefine WEBSHARING_ON>^<IfDefine !0>^" httpd.conf
sudo sed -i '' "s^User _www^User `whoami`^" httpd.conf
sudo sed -i '' "s^Group _www^Group staff^" httpd.conf
echo -e "NameVirtualHost *:80\n\n<Directory />\n AllowOverride All\n Allow from all\n</Directory>\n" | sudo tee extra/httpd-vhosts.conf
cd -
# Everything else # Everything else
brew install unrar brew install unrar
brew install node brew install node
# Remove outdated versions from the cellar # Remove outdated versions from the cellar
brew cleanup brew cleanup
# Node.js
brew install node
npm install -g grunt
npm install -g jshint
npm install -g bower