Skip to content

Instantly share code, notes, and snippets.

@ipfans
Last active January 1, 2016 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipfans/8206547 to your computer and use it in GitHub Desktop.
Save ipfans/8206547 to your computer and use it in GitHub Desktop.
初始化服务器配置
apt-get update
apt-get upgrade
groupadd www
useradd -s /sbin/nologin -g www www
mkdir -p /home/wwwroot/default
chmod +w /home/wwwroot/default
mkdir -p /home/wwwlogs
chmod 777 /home/wwwlogs
touch /home/wwwlogs/nginx_error.log
apt-get install -y mysql-server mysql-client vim
mysql_secure_installation
apt-get install php5-fpm php5-gd php5-mysql php5-curl php5-mcrypt
apt-get install build-essential libpcre3-dev libssl-dev libxml2-dev libxslt1-dev libgd2-xpm-dev
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
wget -O pma.tar.gz http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.1.3/phpMyAdmin-4.1.3-all-languages.tar.gz
vim /etc/php5/fpm/php-fpm.conf # 按需修改
vim /etc/php5/fpm/pool.d/www.conf # 按需修改
service php5-fpm start
vim /usr/local/nginx/conf/nginx.conf # 按需修改
# 启动nginx
nginx
# 结束nginx
kill -INT `cat /var/run/nginx.pid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment