Version 23 (modified by faisal, 16 years ago) |
---|
Setting up a server for HG Platform using NGINX PHP5 MySQL
From an Ubuntu 9.04 Distro:
- Edit /etc/apt/source.list and remove the comment on universe package
required installations
apt-get update apt-get upgrade apt-get install language-pack-en subversion postfix emacs portmap nfs-common wget lynx cron
For Postfix: Use setting 'Internet Site' for install type. Use <server name>.healthgurumedia.com for the system name.
Set-up private IP:
emacs /etc/network/interfaces remove last 2 line and add this: auto eth0 eth0:0 iface eth0 inet static address [static ip] netmask 255.255.255.0 gateway [gateway] iface eth0:0 inet static address [private ip] netmask 255.255.128.0 save and run: /etc/init.d/networking restart if this doesn't work leave it and reboot will fix it later
2. Install php mysql nginx
apt-get install ntp ntpdate make bison flex gcc patch autoconf subversion locate unzip gettext libgd2-xpm apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libjpeg-dev libpng-dev apt-get install mysql-client libmysqlclient15-dev mysql-server cd /usr/local/src/ wget http://c1.simplecdn.se/nginx/php-5.3.0.tar.gz wget http://c1.simplecdn.se/nginx/php-5.3.0-fpm-0.5.12.diff.gz tar zvxf php-5.3.0.tar.gz gzip -cd php-5.3.0-fpm-0.5.12.diff.gz | sudo patch -d php-5.3.0 -p1 cd php-5.3.0 ./configure --enable-fpm --with-mysql --with-mysqli --with-gd --with-jpeg-dir --without-sqlite --with-gettext --with-mcrypt --with-zlib --enable-mbstring --without-pgsql --with-curl --disable-debug --enable-pic --disable-pdo --disable-rpath --enable-inline-optimization --with-bz2 --with-xml --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-xslt --enable-memcache --enable-zip --with-pcre-regex --disable-tokenizer --disable-filter --disable-reflection --without-unixODBC --without-odbc --disable-hash make all install strip /usr/local/bin/php-cgi pecl install memcache pecl install apc-beta cp /usr/local/src/php-5.3.0/php.ini-production /usr/local/lib/php/php.ini mkdir /etc/php/ ln -s /usr/local/lib/php/php.ini /etc/php/php.ini ln -s /usr/local/etc/php-fpm.conf /etc/php/php-fpm.conf emacs /etc/php/php-fpm.conf - add line 51,52,63,66 value of www-data for owner,group,user,group emacs /etc/php/php.ini - add at end of file [APC] apc.enabled = 1 apc.shm_segments = 1 apc.shm_size = 30 apc.max_file_size = 10M apc.stat=1 extension=apc.so extension=memcache.so extension=pdo_mysql.so apc.filters = wp-cache-config --- [to recompile php for some reason do] make clean rm config.cache ./configure..... make all install --- NginX Install cd /usr/local/src wget http://sysoev.ru/nginx/nginx-0.7.63.tar.gz tar zxvf nginx-0.7.63.tar.gz && cd nginx-0.7.63 ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module make && sudo make install ln -s /usr/local/nginx /etc/nginx cd /etc/nginx emacs conf/fastcgi_params - replace content with fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; --- emacs /etc/init.d/nginx --- copy paste attached file emacs /etc/init.d/php-fpm --- copy paste attached file chmod +x /etc/init.d/nginx /etc/init.d/php-fpm mkdir /usr/local/nginx/sites-available mkdir /usr/local/nginx/sites-enabled ln -s /usr/local/nginx/sites-enabled /etc/sites update-rc.d nginx defaults update-rc.d php-fpm defaults
3. create folder /mnt/Media then add mount point in fstab for reboot
mkdir /mnt/Media emacs /etc/fstab - add this line 192.168.137.96:/var/www/imageserv/Media /mnt/Media nfs rsize=8192,wsize=8192,timeo=14,intr - save and exit
4. Add new private IP in image server [opossum.healthgurumedia.com]
emacs /etc/exports add new ip in the end separated by space then restart: /etc/init.d/nfs-kernel-server restart
5. reboot the server
6. Create hguser from bilby.healthgurumedia.com in previleges, by simply editing a current hguser and changing the host using the private ip and keep the old entry then click go
7. then setup new webserver by following /wiki/ReleaseChecklist
For release beta 15 must do add new file: emacs /etc/hgplatform.ini
[general] APPLICATION_ENV = production
Attachments
-
liveservers
(1.3 kB) - added by faisal
16 years ago.
nginx server configurations
- nginx.conf (1.0 kB) - added by faisal 16 years ago.
-
spawn-fcgi-php
(1.7 kB) - added by faisal
15 years ago.
spawn fcgi init script