Posts

MYSQL auth with apache .htaccess

MySQL authentication provides a more flexible and powerful system than Basic or Digest authentication. All the username's and passwords can be in database which provides capability to standardize among all web servers. Module: mod_auth_mysql Configure following parameters at .htaccess file AuthType: This need to be Basic. AuthName: This is the name (realm) you want to give to your password protected site. Auth_MYSQLhost: Your MySQL database hostname. Auth_MYSQLusername: Your MySQL database username. Auth_MYSQLpassword: Your MySQL database password. Auth_MYSQLdatabase: This is your database with the member's info. Auth_MYSQLpwd_table: The members info table containing (Apache username/password). Auth_MYSQLuid_field: The username field. Auth_MYSQLpwd_field: The password field. Auth_MYSQL_EncryptedPasswords: Are the password MySQL encrypt. [onoff]. require valid-user Ref: https://www.widexl.com/tutorials/htaccess.html

Increase JVM memory in Linux

You can increase the JVM memory for better performance if your system has sizeable free memory export JAVA_OPTS="-Xms 128m -Xmx 128m -server -Djava.net.preferIPv4Stack=true" You can make it permanent by configuring at .bashrc or .profile Activate with source ~/.bashrc source ~/.profile

Confluence Installation

Confluence is a collaboration software written in Java. Install prerequisite packages  rpm -ivh pcre-devel-4.5-3.i386.rpm rpm -ivh apr-devel-0.9.4-24.1.i386.rpm rpm -ivh apr-util-devel-0.9.4-17.i386.rpm rpm -ivh httpd-devel-2.0.52-9.ent.i386.rpm Uninstall GNU java rpm -e java-1.4.2-gcj-compat rpm -e gcc-java Install jdk =========== chmod +x jdk-1_5_0_08-linux-i586-rpm.bin ./jdk-1_5_0_08-linux-i586-rpm.bin cd /usr/java/jdk1.5.0_08 ln -s /usr/java/jdk1.5.0_08 /usr/java/jdk Install Tomcat ============== #create Tomcat Account groupadd tomcat useradd -g tomcat tomcat cd /usr/local tar xzf apache-tomcat-5.5.17.tar.gz ln -s apache-tomcat-5.5.17 tomcat5 #change ownership cd /usr/local chown -R tomcat.root /usr/local/tomcat5 chown -R tomcat.root /usr/local/apache-tomcat-5.5.17 Set environment variable =============== vi /etc/profile export JAVA_HOME=/usr/java/jdk export CATALINA_HOME=/usr/local/tomcat5 export PATH=$PATH:/usr/java/jdk/bin logout St...

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