Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.

The following error occurs due to memory size assigned to Tomcat service is full.

When you get this error then  just run the commmand :

=============================================================================================

[email protected] [/]#export _JAVA_OPTIONS=”-Xms20m -Xmx64m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:NewSize=10m -XX:MaxNewSize=10m -XX:SurvivorRatio=6 -XX:TargetSurvivorRatio=80 -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled”

=============================================================================================

OR

===========================================
export CATALINA_OPTS=”-Xms1024m -Xmx1024m”

=======================================

Then restart the tomcat service :

[email protected][~]# /usr/local/jakarta/tomcat/bin/./shutdown.sh
[email protected][~]# /usr/local/jakarta/tomcat/bin/./startup.sh
[email protected][~]# /usr/local/jakarta/tomcat/bin/./catalina.sh run

That’s all this will do it.

Redirection from http to https

How to Redirect from http to https.

If  SSL  is installed on the server and you want redirect all requests  to https then you need to add the folloing code in .htaccess file.

================================================

RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

================================================

or

=================================================

RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.domain.com [L,R]

=================================================

Permission Deny Error on .htaccess

Error :

[Tue Dec 01 22:01:42 2009] [crit] [client 127.0.0.1] (13)Permission denied: /home/username/public_html/.htaccess

When you get this errror, then  just run the following commands  :

find -type d -exec chmod 755 {} \;
find -type f -exec chmod 644 {} \;
chown usename.username  * -R

That’s all this will do it.