手动编译安装nginx 1.0.5
echo 复制下面整段shell到命令行终端中,会自动逐条执行。 wget tar -jxvf nginx-1.0.5.tar.gz cd nginx-1.0.5 sudo apt-get install libpcre3 libpcre3-dev ./configure --prefix=/usr/local/nginx make sudo make install sudo ln -s /usr/local/nginx/sbin/nginx /etc/init.d/ echo 启动nginx sudo /etc/init.d/nginx echo 访问本机首页,如果正常,则说明nginx已启动 wget -O - 手动安装mysql 手动编译安装php 5.3.8常用扩展:curl、pdo、pdo-mysql、mysqli、openssl、gd、jpeg、png、exif、zip、magickwand
sudo apt-get install libltdl-dev libssl-dev sendmail libjpeg8 libjpeg8-dev libpng12-0 libpng12-dev libxml2-dev libcurl4-openssl-dev libmcrypt-dev sudo ln -s /usr/lib/x86_64-linux-gnu/libpng* /usr/lib/ echo 根据PHP官方推荐,使用mysqli和pdo_mysql,而不使用mysql。gmail stmp需要openssl。 wget tar -jxvf php-5.3.8.tar.bz2 cd php-5.3.8 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-openssl --with-imap-ssl --with-gd --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ --enable-exif --enable-zip make sudo make install sudo cp php.ini-development /usr/local/php/lib/php.ini sudo ln -s /usr/local/php/bin/php /usr/bin/php sudo cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf sudo vi /usr/local/php/etc/php-fpm.conf pid = run/php-fpm.pid error_log = log/php-fpm.log log_level = notice pm.start_servers pm.min_spare_servers pm.max_spare_servers sudo cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm sudo chmod 755 /etc/init.d/php-fpm echo 把php-fpm加入服务,开机自启动 sudo update-rc.d php-fpm defaults sudo /usr/local/php/sbin/php-fpm sudo vi /usr/local/nginx/conf/nginx.conf location / { root /usr/www; index index.html index.htm index.php; } location ~ \.php$ { root /usr/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } sudo killall nginx sudo /etc/init.d/nginx