Created
September 11, 2013 17:39
-
-
Save 7hunderbird/6527087 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-12.04-lts | |
mkdir -p ~/code/personal/vagrant-php | |
cd ~/code/personal/vagrant-php | |
download vagrant | |
http://downloads.vagrantup.com/ | |
install vagrant latest version | |
When you run vagrant init, it creates a "box" with the name you give and the url to the give. The default is to use a public URL, but if you've got a local URL you can do that too. | |
like | |
vagrant init funbox ~/path-to-funbox | |
or the most common idea | |
vagrant init precise32 http://files.vagrantup.com/precise32.box | |
And this will create a box in the ~/.vagrant.d/ | |
### Boxes | |
For a list of boxes go to http://www.vagrantbox.es/Vv | |
### Create VMWare | |
vagrant init precise64_vmware http://files.vagrantup.com/precise64_vmware.box | |
### Install Vagrant Plugin | |
Download the license file then copy it to the current vagrant-php code project. | |
cp ~/Downloads/license.lic . | |
vagrant plugin install vagrant-vmware-fusion | |
vagrant plugin license vagrant-vmware-fusion license.lic | |
### Start the server | |
vagrant up --provider=vmware_fusion | |
First time it will ask you to put in your password. | |
[default] VMware requires root privileges to make many of the changes | |
necessary for Vagrant to control it. In a moment, Vagrant will ask for | |
your administrator password in order to install a helper that will have | |
permissions to make these changes. Note that Vagrant itself continues | |
to run without administrative privileges. | |
Password: | |
### Change Vagrantfile | |
config.vm.provider "vmware_fusion" do |v| | |
v.vmx["memsize"] = "1024" | |
v.vmx["numvcpus"] = "2" | |
end | |
config.vm.network :private_network, ip: "192.168.33.10" | |
vagrant reload | |
## Install Nginx and all that on the vagrant box | |
### Sign in and Update Apt-Get | |
Become super user and update apt-get. | |
sudo su | |
apt-get update | |
### Install MySQL 5 | |
apt-get install mysql-server mysql-client | |
### Install Nginx | |
apt-get install nginx curl | |
/etc/init.d/nginx start | |
The default nginx document root on Ubuntu 12.04 is /usr/share/nginx/www. | |
### Installing PHP5 | |
apt-get install php5-fpm | |
PHP-FPM is a daemon process (with the init script /etc/init.d/php5-fpm) that runs a FastCGI server on port 9000. | |
### Configuring nginx | |
modify /etc/nginx/nginx.conf | |
nano /etc/nginx/nginx.conf | |
keepalive_timeout 2; | |
nano /etc/nginx/sites-available/default | |
https://gist.github.com/7hunderbird/1dd07fdd9262f40ac7c3 | |
/etc/init.d/nginx reload | |
### Create a info.php | |
/usr/share/nginx/www/info.php | |
<?php | |
phpinfo(); | |
?> | |
### Getting MySQL Support In PHP5 | |
apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl | |
apt-get install php5-xcache | |
/etc/init.d/php5-fpm reload | |
### Reconfigure PHP-FPM to use an Unix Socket | |
nano /etc/php5/fpm/pool.d/www.conf | |
/etc/init.d/php5-fpm reload | |
nano /etc/nginx/sites-available/default | |
fastcgi_pass unix:/tmp/php5-fpm.sock; | |
/etc/init.d/nginx reload | |
### Create a new site | |
cd /usr/share/nginx/www | |
mkdir dev.garympomerantz.com | |
cp /etc/nginx/sites-available/default /etc/nginx/sites-available/dev.garympomerantz.com | |
cd /etc/nginx/sites-enabled/ | |
ln -s /etc/nginx/sites-available/dev.garympomerantz.com dev.garympomerantz.com | |
nano /etc/nginx/sites-available/dev.garympomerantz.com | |
### Create an /etc/hosts record | |
In order to make it so that the http://dev.garympomerantz.com runs locally, modify the /etc/hosts file. | |
subl /etc/hosts | |
192.168.33.10 dev.garympomerantz.com | |
### install wordpress | |
mkdir -p /home/vagrant/src | |
cd /home/vagrant/src | |
wget http://wordpress.org/latest.tar.gz | |
tar -zxvf latest.tar.gz | |
cd wordpress/ | |
cp -R * /usr/share/nginx/www/dev.garympomerantz.com/ | |
### Create a Wordpress database | |
mysql -uroot -e "create database wordpress"; | |
### fixing permissions | |
cd /usr/share/nginx/www | |
find /usr/share/nginx/www/ -type d -exec chmod 755 {} \; | |
find /usr/share/nginx/www/ -type f -exec chmod 644 {} \; | |
chown -R www-data:www-data /usr/share/nginx/www/dev.garympomerantz.com | |
chmod -R 755 /usr/share/nginx/www/ | |
### Increase max upload in nginx and php | |
nano /etc/nginx/nginx.conf | |
client_max_body_size 50M; | |
/etc/init.d/nginx restart | |
nano /etc/php5/fpm/php.ini | |
upload_max_filesize 50M | |
/etc/init.d/php5-fpm restart | |
### Install plugins | |
Install all the plugins, except w3 total cache which is installed only on production. | |
### Import Process | |
Tools > Import | |
This will import stuff like pages and their data. | |
It will not import various stuff like plugin settings or Menu settings. | |
So we need to modify the "Settings" like... | |
Settings > General > Tagline | |
Settings > Reading > Front page displays | |
So it shows a static page of the home page. | |
Settings > Permalinks > Common Settings | |
Change this to "Post Name" radio option. | |
### Configure Menus | |
Appearance > Menus | |
Make sure theirs no dupilication in the Top Navigation. | |
Then go to the Manage Locations top Tab. And click on the Theme Location's Navigation Menu. This will allow you to assign the Top Navigation as the navigation to use at the top of the homepage. | |
### Install DMS | |
Now that we've got the "data" in, the site mostly configred and the menu mostly in place, we're ready to install DMS and import it's settings. | |
Appearance > Themes > Install Themes tab | |
Click on the upload link. | |
Choose the file and then find the dms.zip file. Activate that bad boy. | |
### Activate DMS | |
redacted | |
### Import DMS | |
Once you've activated DMS you're ready to import the settings. | |
Click on the Global Options tab, then click on Import + Export. | |
Choose the green Select config file (.json) to open your exported configuration settings from before. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment