Posts

Increase PHP upload file size

Come across to increase PHP upload file size is very common in Linux, Apache, MySQL, and PHP (LAMP) environment. Edit /etc/php.ini 1. max_execution_time = 30 -> 300 2. memory_limit = 8M -> 16MB 3. post_max_size = double of upload size e.g upload size 10 MB -> post_max_size 20 MB 4. upload_max_filesize = 10M Edit /etc/httpd/conf.d/php.conf Change LimitRequestBody

Maths editor for web applications

Image
Javascript Mathematical editor for your web application. Really great editor. Source: http://asciimath.org/

Increase MySQL max concurrent connection limit

MySQL max default concurrent connection limit is 100. We should increase for high-performance system. Edit  /etc/my.cnf [mysqld] set-variable=max_connections=250 ------------------------------------------------------------------------------------ If your application is php program, you might want to prevent persistent links. Edit /etc/php.ini [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent=Off ---------------------------------------------------------------------------------- Note: Applicable to MySQL 3.x

Setup Blog using Wordpress

Wordpress is a popular opensource publishing engine. Prerequisite 1. Install apache webserver 2. Install MySQL DB server Steps for installation 1. download latest tar.gz from Wordpress website. 2. upload your server 3. extract tar -xzvf latest.tar.gz 4. Create DB for wordpress 5. copy wp-config-sample.php to wp-config.php 6. Browse and install (e.g http://localhost/wordpress/wp-admin/install.php) For more details  www.wordpress.org

Firewall with iptables

This installation steps are applied at Redhat Linux. However, it should be fine with other distributions also. 1. Check for installation status of iptables service rpm -q iptables 2. This step is important if your server have FTP service. insmod ip_conntrack_ftp (redhat 9) modprobe  ip_conntrack_ftp (rhel) 3. create file vi /root/primary_firewall #The NAT portion of the ruleset. Used for Network Address Transalation. #Usually not needed on a typical web server, but it's there if you need it. *nat :PREROUTING ACCEPT [127173:7033011] :POSTROUTING ACCEPT [31583:2332178] :OUTPUT ACCEPT [32021:2375633] COMMIT #The Mangle portion of the ruleset. Here is where unwanted packet types get dropped. #This helps in making port scans against your server a bit more time consuming and difficult, but not impossible. *mangle :PREROUTING ACCEPT [444:43563] :INPUT ACCEPT [444:43563] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [402:144198] :POSTROUTING ACCEPT [402:144198] -A PREROUTING -p tcp -m tcp --tc...

Qmail Mail Server Setup

Qmail is a popular mail service among the opensource community. It is a security-focused MTA engine. Based on my project requirements, I need to setup complete Email solution with webmail, POP3 and IMAP. Preparation 1. Get a public IP from your ISP 2. Domain registration (e.g Enom, Godaddy, Namecheap) 3. Check your MX, SPF and Reverse DNS MX record for mail domain Reverse DNS IP (PTR) must request to ISP because IP address is owned by ISP. Setup For this setup, Redhat 9 is installed as a based OS and followed Qmailrocks steps  www. qmail rocks.org . Qmailrocks provides very details steps to achieve fully functional Mail Service. Key components Qmail/Qmailadmin Autoresponder Vpopmail, Vqadmin (host multiple domains) Maildrop (mail filtering) Courier-imap (IMAP service) SquirrelMail (Webmail client) Clam Antivirus SpamAssassin Ref: www. qmail .org www.lifewith qmail .org www. qmail rocks.org

Disk quota configration at RedHat Linux

Linux OS disk quota configuration for local users and group. Install Binary Package rpm –i quota~.rpm Modify /etc/fstab LABEL=LINUX / ext3 defaults,usrquota,grpquota 1 1 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 /dev/cdrom /mnt/cdrom udf,iso9660 auto,owner,kudzu,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0 Create Quota Files touch /aquota.user touch /aquota.group chmod 600 /aquota.user chmod 600 /aquota.group Reboot the system reboot or mount / -o rw,remount Test the quota mount Quotacheck quotacheck –aumv quotacheck –avgm ( group ) Quota On quotaon –auvg Assign for User/Group edquota –u username edquota –g groupname In this part, you would set limit for Users' Soft and Hard limit. Quota Commands quotacheck quotaon/off quotastats setquota quota repquota