Include /usr/local/nginx/sites-enabled/* ĩ.) Concatenate the parameters below to /usr/local/nginx/conf/fastcgi_paramsġ0.) create a SystemV style init script and store it in /etc/init.d/nginx. '"$http_user_agent" "$http_x_forwarded_for"' Īccess_log /var/log/nginx_access.log main Įrror_log /var/log/nginx_error.log debug '"$request" $status $body_bytes_sent "$http_referer" ' Log_format main '$remote_addr - $remote_user ' Gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript configure -sbin-path=/usr/local/sbin -with-http_ssl_module -without-mail_pop3_module -without-mail_imap_module -without-mail_smtp_module -with-http_stub_status_moduleĨ.) Edit Nginx configuration at /usr/local/nginx/conf/nf, please change the lines blew: Please go to to find the lastest stable version: Therefore, we are going to complie nginx from the latest stable version. Sudo ln -s /usr/local/etc/nf /etc/php/nfĦ.) Update Permission for PHP-FPM at /etc/php/nfĪltough Nginx is already available in the Ubuntu third-party module repositories, the version is updated. Sudo ln -s /usr/local/lib/php.ini /etc/php/php.ini Sudo cp /usr/local/src/php-5.2.17/php.ini-recommended /usr/local/lib/php.ini Please note when you build the APC extension, make sure you turn off the option to compile for apache, since we will be using Nginx. Sudo cp sapi/cgi/fpm/php-fpm /etc/init.d/ configure -enable-fastcgi -enable-fpm -with-mcrypt -with-zlib -enable-mbstring -enable-pdo -with-curl -disable-debug -with-pic -disable-rpath -enable-inline-optimization -with-bz2 -enable-xml -with-zlib -enable-sockets -enable-sysvsem -enable-sysvshm -enable-pcntl -enable-mbregex -with-mhash -with-xsl -enable-zip -with-pcre-regex -with-gd -without-pdo-sqlite -with-pdo-mysql -without-sqlite -with-jpeg-dir=/usr/lib -with-png-dir=/usr/lib -with-freetype-dir=/usr/lib -with-mysql -with-mysqli At the time that this blog was written, the latest version was 5.2.17 So, we will use the latest 5.2.x version. Sudo aptitude install make bison flex gcc patch autoconf locate libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpng3-dev libjpeg-dev libxslt-dev libmysqlclient15-dev libfreetype6 libfreetype6-devģ.) Compile PHP from source with PHP-FPM patches:īecause Drupal 7 still has compatibility issue with PHP.5.3.x at the moment. (There is a great tutorial written in 2008, based on that, I have updated a few steps, and added a few things for Drupal 7:) Insert “pre-up iptables-restore < /etc/les" as the third line in the file so it looks like this: Sudo nano /etc/network/interfaces.template Last step make sure they’re saved and reloaded at bootup: A INPUT -p icmp -m icmp -icmp-type 8 -j ACCEPT A INPUT -p tcp -m state -state NEW -dport 21 -j ACCEPT # Purely optional, but required for WordPress to install its own plugins or update itself. A INPUT -p tcp -m state -state NEW -dport 22 -j ACCEPT # Change the value 22 if you are using a non-standard port A INPUT -m state -state ESTABLISHED,RELATED -j ACCEPT # Allow loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use the lo0 interface These rules state that outgoing connections are just fine, but all incoming traffic to any port other than 80, 443, 22 or 21 is blocked - unless it’s already been established legitimately. We’ll go ahead and secure the firewall in your iptables by adding rules:Īdd the rules seen in the example below so that your /etc/les looks just like it. Now exit your SSH connection as root, and re-login as admin All you need to do to grant sudo privileges to admin is to add a line beneath root’s, so that it looks like this: The visudo command will open up the /etc/sudoers file. ĭpkg-reconfigure locales (# then select en_US.UTF8) I got a bare-bone Debian 5 from, then, here is how it goes:ġ.) Configure SSH and accounts to make it more secure login as root (This step is optional). This note is also reviewed and improved by Eric E Moore from Brandorr Inc Therefore, I am writing down my notes here for sharing. Since the stack: Nginx + PHP-FPM + APC + Memcache + Drupal 7 is quite on the cutting edge at the moment (Oct.2010), and there is not many 'master' tutorials available. I am not hosting administration expert, nor intent to make this tutorial post as generic as it would work for everybody.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |