FreeBSD 8.0 builds nginx + jexus + PHP + Asp.net + MySQL scripts

Source: Internet
Author: User
Tags imagemagick mcrypt

A script that was written when FreeBSD 8.0 web server environment was installed a few days ago has passed the test in FreeBSD 8.0, but it is not a one-click installation. You can copy and paste the script for manual operation. This reduces the time required to input commands and reduces the chance of errors. In the future, I will modify the script so that it can be installed with one click.

#! /Bin/sh
######################################## #######
# Ver 0.1.0
# Applicable to FreeBSD 7.2 and 8.0. We recommend that you use FreeBSD 8.0.
######################################## #######

################ Install a security patch ##################
FreeBSD-update fetch
FreeBSD-update install

############### Copy required files ##################
Tar zxvf femp-0.1.0.tar.gz # All the installation files involved, because of the large not provide download, can be made by themselves
CD FEMP

################ Update ports ##################
Tar zxvf ports.tar.gz
CP-r ports // usr/ports/distfiles/

################ Install PCRE ##################
CD/usr/ports/devel/PCRE
Make install clean
Rehash

################ Install XML ##################
CD/usr/ports/textproc/libxml
Make install clean

CD/usr/ports/textproc/libxml2
Make install clean

################ Install curl ##################
CD/usr/ports/FTP/curl
Make install clean

################ Install JPEG ##################
CD/usr/ports/graphics/JPEG
Make install clean

################ Install PNG ##################
CD/usr/ports/graphics/PNG
Make install clean

################ Install FreeType ##################
CD/usr/ports/print/FreeType
Make install clean

CD/usr/ports/print/FreeType2
Make install clean

################ Install Autoconf ##################
CD/usr/ports/devel/autoconf262
Make install clean

################ Install 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/

################ Install MySQL ##################
Tar zxvf mysql-5.1.41.tar.gz
CD mysql-5.1.41
. /Configure -- prefix =/usr/local/MySQL/-- enable-validator -- With-extra-charsets = Complex -- enable-thread-safe-client -- With-big-tables -- -Readline -- With-SSL -- With-embedded-server -- enable-local-infile -- With-plugins = Innobase -- With-mysqld-user = MySQL -- without-NDB-Debug -- -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 '123 ';
# Quit

CD/home/imarmot/FEMP/

################ Install 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 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 -- -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 ..

############### Create a required directory ##################
Mkdir-P/data/PHP/eaccelerator_cache

Mkdir-P/data/WWW
Chmod + w/data/WWW
Chown-r www: www/data/WWW

############### Copy the Startup File ##################
Cp rc. Local/etc/

################ Install mono ##################
CD/usr/ports/lang/mono
Make install clean

################ Install mono ##################
CD/home/imarmot/FEMP/
Tar zxvf jexus-3.3.tar.gz
Mkdir/usr/local/jexus/
CP-r jexus-3.3/usr/local/jexus/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.