PHPlnmp环境搭建

sudo apt-get install -y git qgit vim
sudo apt-get install -y nginx
sudo apt-get install -y mysql-server mysql-client
sudo apt-get install -y redis-server
sudo apt-get install -y flex curl tig ffmpeg xpdf make gcc
sudo apt-get install -y libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libjpeg-dev libgif-dev libfreetype6-dev ttf-wqy-microhei ttf-wqy-zenhei g++
sudo apt-get install -y php5 php5-xdebug php5-gd php5-curl php5-mysql php5-fpm php-pear php5-dev php5-json
sudo apt-get install -y nodejs python-setuptools
sudo npm install -g resource_build
sudo pecl install redis

[redis]
extension=redis.so

listen = 127.0.0.1:9000

代码(此处如果你的代码根目录为:~/workspace/):

在mysqld节点下添加

lower_case_table_names = 1

Nginx:

sudo gedit /etc/nginx/sites-available/www.yourname.aysaas.com

server {
server_name
www.yourname.aysaas.com;

root /home/yourname/workspace/saas/public;

error_log
/var/log/nginx/www.yourname.aysaas.com-error.log
error;

access_log
/var/log/nginx/www.yourname.aysaas.com-access.log
combined;

location /global/svgweb/ {
break;
}

location /global/jquery/extend/uploadify/ {
break;
}

location /global/pdf2swf/ {
break;
}

location /form/render/ueditor/ {
break;
}

location /favicon.ico {
break;
access_log off;
log_not_found off;
}

location / {
rewrite . /index.php;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

server {
server_name static.yourname.aysaas.com;

root /home/yourname/workspace/saas/public;

location / {
access_log off;
}

location ~ .php$ {
PHP,deny all;
}

location ~* .(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
}

server {
server_name fileio.yourname.aysaas.com;
root /home/yourname/workspace/saas/public;
client_max_body_size 128m;/jigouxinxi/index
location /crossdomain.xml {
break;
}

location / {
rewrite . /index.php ;
}

location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

sudo ln -s /etc/nginx/sites-available/www.yourname.aysaas.com /etc/nginx/sites-enabled/
sudo /etc/init.d/nginx restart

Hosts:

sudo gedit /etc/hosts

127.0.0.1
www.yourname.aysaas.com
127.0.0.1 static.yourname.aysaas.com
127.0.0.1 fileio.yourname.aysaas.com

Composer:

sudo apt-get install -y zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
sudo chsh -s /bin/zsh

Zsh:

软件设置:
Base:

sudo gedit /etc/mysql/my.cnf
sudo gedit /etc/php5/fpm/pool.d/www.conf
wget http://www.swftools.org/swftools-2013-04-09-1007.tar.gz
tar -zvxf swftools-2013-04-09-1007.tar.gz
cd swftools-2013-04-09-1007
sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
sudo make
sudo make install

error_reporting = E_ALL
display_errors = On
html_errors = On
date.timezone = Asia/Shanghai

履新软件源:

PATH=”$PATH:$HOME/bin”
export PATH

配置:
PHP:

Mysql:

sudo gedit /etc/php5/mods-available/redis.ini
cd ~/
mkdir bin
curl -s https://getcomposer.org/installer | php -- --install-dir=$HOME/bin
chmod +x bin/composer.phar
sudo gedit /etc/profile

软件源设置:
拉长特殊软件源:
sudo apt-get install -y python-software-properties
software-properties-common
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update
sudo /etc/init.d/php5-fpm restart
sudo ln -s /etc/php5/mods-available/redis.ini /etc/php5/cli/conf.d/
sudo gedit /etc/php5/fpm/php.ini
mkdir ~/workspace
cd ~/workspace/
git clone git@coding.net:breestealth/SAAS.git
cd ~/workspace/SAAS
chmod 777 -R log
mkdir upload
chmod 777 -R upload
composer.phar install

Swftools:

相关文章