FreeBSD 8.0搭建nginx+jexus+php+asp.net+mysql脚本
2010-09-03 21:13
417 查看
前几天安装FreeBSD 8.0 Web服务器环境的时候写的一个脚本,已经在FreeBSD 8.0下测试通过,不过不是一键安装,大家可以照脚本复制粘贴手工进行操作。可以节省输入命令的时间,减少了出错的几率。未来我将对脚本进行修改,以使其 真正做到一键安装。
#!/bin/sh
###############################################
# ver 0.1.0
# 适用于 FreeBSD 7.2、8.0,推荐使用 FreeBSD 8.0
###############################################
################ 加装安全补丁 ##################
freebsd-update fetch
freebsd-update install
################ 复制必需的文件 ##################
tar zxvf femp-0.1.0.tar.gz #涉及到的所有安装文件,由于较大就不提供下载了,可自行制作
cd femp
################ 更新ports ##################
tar zxvf ports.tar.gz
cp -r ports/ /usr/ports/distfiles/
################ 安装pcre ##################
cd /usr/ports/devel/pcre
make install clean
rehash
################ 安装xml ##################
cd /usr/ports/textproc/libxml
make install clean
cd /usr/ports/textproc/libxml2
make install clean
################ 安装curl ##################
cd /usr/ports/ftp/curl
make install clean
################ 安装jpeg ##################
cd /usr/ports/graphics/jpeg
make install clean
################ 安装png ##################
cd /usr/ports/graphics/png
make install clean
################ 安装freetype ##################
cd /usr/ports/print/freetype
make install clean
cd /usr/ports/print/freetype2
make install clean
################ 安装autoconf ##################
cd /usr/ports/devel/autoconf262
make install clean
################ 安装nginx ##################
cd /home/imarmot/femp/
tar zxvf nginx-0.7.64.tar.gz
cd nginx-0.7.64
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
cd ..
cp nginx.conf /usr/local/nginx/conf/
################ 安装mysql ##################
tar zxvf mysql-5.1.41.tar.gz
cd mysql-5.1.41
./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase --with-mysqld-user=mysql --without-ndb-debug --without-debug --with-charset=utf8 --localstatedir=/data/mysql/data --with-collation=utf8_general_ci
make
make install
cd ..
pw groupadd mysql
pw useradd mysql -g mysql -d /data/mysql -s /usr/sbin/nologin
mkdir -p /data/mysql/data/
chown -R mysql:mysql /data/mysql/
/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql
cd /usr/local/mysql/share/mysql
cp my-large.cnf /etc/my.cnf
cp mysql.server /usr/local/mysql/mysqld
chmod 755 /usr/local/mysql/mysqld
/usr/local/mysql/mysqld start
/usr/local/mysql/bin/mysql -u root -p -S /tmp/mysql.sock
# GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';
# quit
cd /home/imarmot/femp/
################ 安装PHP ##################
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr
make
make install
cd ..
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure --prefix=/usr
make
make install
cd ..
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
./configure --prefix=/usr
make
make install
cd ..
tar zxvf php-5.2.11.tar.gz
gzip -cd php-5.2.11-fpm-0.5.13.diff.gz | patch -d php-5.2.11 -p1
cd php-5.2.11
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/local --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --disable-ipv6 --without-pear
make ZEND_EXTRA_LIBS='-liconv'
make install
cd ..
cp ./php.ini /usr/local/php/etc/
cp ./php-fpm.conf /usr/local/php/etc/
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make
make install
cd ..
tar zxvf ImageMagick-6.5.4-2.tar.gz
cd ImageMagick-6.5.4-2
./configure
make
make install
cd ..
tar zxvf imagick-2.2.2.tgz
cd imagick-2.2.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
################ 创建需要的目录 ##################
mkdir -p /data/php/eaccelerator_cache
mkdir -p /data/www
chmod +w /data/www
chown -R www:www /data/www
################ 复制启动文件 ##################
cp rc.local /etc/
################ 安装mono ##################
cd /usr/ports/lang/mono
make install clean
################ 安装mono ##################
cd /home/imarmot/femp/
tar zxvf jexus-3.3.tar.gz
mkdir /usr/local/jexus/
cp -r jexus-3.3/ /usr/local/jexus/
#!/bin/sh
###############################################
# ver 0.1.0
# 适用于 FreeBSD 7.2、8.0,推荐使用 FreeBSD 8.0
###############################################
################ 加装安全补丁 ##################
freebsd-update fetch
freebsd-update install
################ 复制必需的文件 ##################
tar zxvf femp-0.1.0.tar.gz #涉及到的所有安装文件,由于较大就不提供下载了,可自行制作
cd femp
################ 更新ports ##################
tar zxvf ports.tar.gz
cp -r ports/ /usr/ports/distfiles/
################ 安装pcre ##################
cd /usr/ports/devel/pcre
make install clean
rehash
################ 安装xml ##################
cd /usr/ports/textproc/libxml
make install clean
cd /usr/ports/textproc/libxml2
make install clean
################ 安装curl ##################
cd /usr/ports/ftp/curl
make install clean
################ 安装jpeg ##################
cd /usr/ports/graphics/jpeg
make install clean
################ 安装png ##################
cd /usr/ports/graphics/png
make install clean
################ 安装freetype ##################
cd /usr/ports/print/freetype
make install clean
cd /usr/ports/print/freetype2
make install clean
################ 安装autoconf ##################
cd /usr/ports/devel/autoconf262
make install clean
################ 安装nginx ##################
cd /home/imarmot/femp/
tar zxvf nginx-0.7.64.tar.gz
cd nginx-0.7.64
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
cd ..
cp nginx.conf /usr/local/nginx/conf/
################ 安装mysql ##################
tar zxvf mysql-5.1.41.tar.gz
cd mysql-5.1.41
./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase --with-mysqld-user=mysql --without-ndb-debug --without-debug --with-charset=utf8 --localstatedir=/data/mysql/data --with-collation=utf8_general_ci
make
make install
cd ..
pw groupadd mysql
pw useradd mysql -g mysql -d /data/mysql -s /usr/sbin/nologin
mkdir -p /data/mysql/data/
chown -R mysql:mysql /data/mysql/
/usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql
cd /usr/local/mysql/share/mysql
cp my-large.cnf /etc/my.cnf
cp mysql.server /usr/local/mysql/mysqld
chmod 755 /usr/local/mysql/mysqld
/usr/local/mysql/mysqld start
/usr/local/mysql/bin/mysql -u root -p -S /tmp/mysql.sock
# GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';
# quit
cd /home/imarmot/femp/
################ 安装PHP ##################
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr
make
make install
cd ..
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure --prefix=/usr
make
make install
cd ..
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
./configure --prefix=/usr
make
make install
cd ..
tar zxvf php-5.2.11.tar.gz
gzip -cd php-5.2.11-fpm-0.5.13.diff.gz | patch -d php-5.2.11 -p1
cd php-5.2.11
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/local --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --disable-ipv6 --without-pear
make ZEND_EXTRA_LIBS='-liconv'
make install
cd ..
cp ./php.ini /usr/local/php/etc/
cp ./php-fpm.conf /usr/local/php/etc/
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3
/usr/local/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
tar zxvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make
make install
cd ..
tar zxvf ImageMagick-6.5.4-2.tar.gz
cd ImageMagick-6.5.4-2
./configure
make
make install
cd ..
tar zxvf imagick-2.2.2.tgz
cd imagick-2.2.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
cd ..
################ 创建需要的目录 ##################
mkdir -p /data/php/eaccelerator_cache
mkdir -p /data/www
chmod +w /data/www
chown -R www:www /data/www
################ 复制启动文件 ##################
cp rc.local /etc/
################ 安装mono ##################
cd /usr/ports/lang/mono
make install clean
################ 安装mono ##################
cd /home/imarmot/femp/
tar zxvf jexus-3.3.tar.gz
mkdir /usr/local/jexus/
cp -r jexus-3.3/ /usr/local/jexus/
相关文章推荐
- How to Install Nginx, PHP, PHP Extensions, MySQL, and Zend Optimizer on FreeBSD 7
- 《APMServ 5.2.6》:一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP平台的绿色软件[转]
- freebsd ports安装 nginx+php+mysql+fastcgi配置记录
- 用APMServ一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP运行平台
- 用 Jexus ASP.NET WEB服务器搭建 PHP 网站的具体方法
- ubuntu16搭建php7+phpredis拓展+nginx+mysql脚本(aws)
- FreeBSD7.0 mysql-5.0.51a,nginx-0.6.30,lighttpd-1.4.19,php-5.2.6
- 《APMServ 5.2.6》:一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP平台的绿色软件[原创]
- Ubuntu Server 16.04下ASP.NET Core Web Api + MySql + Dapper在 Jexus、nginx 下的简单测试
- freebsd+nginx+php+mysql+zend+phpmyadmin+系统优化+防止ddos +傻瓜式ports安装法
- freebsd+nginx+mysql+php-fpm+phpmyadmin+haproxy安装日志
- 《APMServ 5.2.6》:一键快速搭建Apache+PHP+MySQL+Nginx+Memcached+ASP平台的绿色软件[原创]
- 如何搭建LNMP环境(Linux+Nginx+MySql+Php)来运行wordpress
- LNMP(linux+nginx+mysql+php)环境搭建_1
- web环境搭建之Linux--nginx-php-mysql
- centos搭建nginx,php,mysql
- 全新安装Mac OSX 开发者环境 同时使用homebrew搭建 PHP,Nginx ,MySQL,Redis,Memcache ... ... (LNMP开发环境)
- ubuntu 搭建nginx,php ,mysql
- PHP 5+MySQL+SQLite+Zend+ASP+ASP.NET+Perl+CGIOpenSSL的服务器一个软件搞定