Wednesday, 28 May 2014

install alternate PHP version along with current version

Requirement: The client is hosted on a server with php 5.3 and he want to enable  5.4 for his domain. To this, we are installing php 5.4 to another location in  the same server.
1. cd /usr/src
2. Download PHP version from http://in3.php.net/get/php-5.4.28.tar.gz/from/a/mirror using wget
3. tar -xzvf php-5.4.28.tar.gz
4. cd php-5.4.28
5. Make sure the installation path --prefix is specified and is compiled as cgi using the option --enable-cgi. In this case I am using the installation path as --prefix=/usr/local/php54
Make sure to remove the configuration parameter for apxs  ie   --with-apxs2=/usr/local/apache/bin/apxs

./configure  --disable-fileinfo --disable-phar --enable-bcmath --enable-calendar --enable-libxml --enable-mbstring --enable-pdo=shared --enable-soap --enable-sockets --enable-wddx --enable-zend-multibyte --enable-zip --prefix=/usr/local/php54 --enable-cgi --with-bz2 --with-curl=/opt/curlssl/ --with-curlwrappers --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mm=/opt/mm/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-pspell --with-tidy=/opt/tidy/ --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr

6. make
7. make install

Now, check if binary is installed:
===
/usr/local/php5/bin/php-cgi -v
===
It should show as cgi.
Now add the following lines on top of the httpd.conf file
===
ScriptAlias /php54/ /usr/local/php54/bin/
Action application/x-httpd-php54 /php54/php-cgi
<Directory “/usr/local/php54/bin/”>
Allow from all
</Directory>
===
Save httpd.conf file and restart apache.
Open a .htaccess file inside the folder where you need php5 and add the following code to it. Make sure .htaccess support is enabled in your apache configuration.
===
AddHandler application/x-httpd-php54 .php
===
Make a phpinfo.php file in this directory and see what is shows when taken in browser. It should be php5.4

Joomla login not accepting

Issue: joomla not accepting the logins we are providing. It just refresh the page when we click login button after enter the login credential, and stay on the same login page. 
Possible fixes:
1. Give 777 permission for the directory specified for 'session.save_path' in the php.ini file.
2. Try changing the  'session.save_path' in the php.ini file and give 777 permission to it.
3. Another work around is change "var $session_handler = 'database';" to var $session_handler = 'None';  OR vice versa in configuration.php file.

Friday, 28 June 2013

Reset railo password

Reset Railo Server Admin Password:

1. Open the file /opt/railo/lib/railo-server/context/railo-server.xml

2. Look for the line that has "<railo-configuration" and blank out the value of password="".

3.  Restart the railo service

4. When you reload again the railo server admin URL http://IP/railo-context/admin/server.cfm, you can set the new password.

Update Mura version

To update your Mura install to the latest release, follow these steps:

1. Go to Site Settings > Global Settings
   2. Click "Update Core Files to Latest Version"
   3. Wait patiently....there are a LOT of files to update
   4. Go to Site Settings > Edit Current Site and click "Update Site Files to Latest Version" OR manually update the following directories: "/[siteID]/includes/display_objects/formbuilder/" and "/[siteID]/includes/data_collection/index.cfm"

There may be permission issues while doing this step from Mura admin panel. If so set permission 777 to all files that shows issues temporarily until the updation completed and then revert the changes back.
   5. Reload Mura

Enable mod_expire apache module

mod_expire controls the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered "expired" and invalid, and a new copy must be obtained from the source.

Following are the steps to enable  mod_expire in the server.

* Open the file /etc/httpd/conf/httpd.conf and check if the following line present in it.


LoadModule expire_module modules/mod_expire.so
 
If not, add it.
 
* Then  create a new file /etc/httpd/conf.d/expire.conf with the lines:
 
 <IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/jpg "access plus 60 days"
 ExpiresByType image/png "access plus 60 days"
 ExpiresByType image/gif "access plus 60 days"
 ExpiresByType image/jpeg "access plus 60 days"
 ExpiresByType text/css "access plus 1 days"
 ExpiresByType image/x-icon "access plus 1 month"
 ExpiresByType application/pdf "access plus 1 month"
 ExpiresByType audio/x-wav "access plus 1 month"
 ExpiresByType audio/mpeg "access plus 1 month"
 ExpiresByType video/mpeg "access plus 1 month"
 ExpiresByType video/mp4 "access plus 1 month"
 ExpiresByType video/quicktime "access plus 1 month"
 ExpiresByType video/x-ms-wmv "access plus 1 month"
 ExpiresByType application/x-shockwave-flash "access 1 month"
 ExpiresByType text/javascript "access plus 1 week"
 ExpiresByType application/x-javascript "access plus 1 week"
 ExpiresByType application/javascript "access plus 1 week"
</IfModule>
 
* Restart apache service. 

Internal Server Error while access CSF or CSP in WHM

Problem: When you tried to access Config Security Policies  or ConfigServer Security & Firewall in WHM, you may get this error

Internal Server Error

500

No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/addon_csf.cgi): subprocess exited with status 2

Solution: Run the following command after logged in to the server as root

root@server [~]# curl -s configserver.com/free/csupdate | perl


Thursday, 20 June 2013

Reset An Account Password in Plesk

1. Login to Plesk admin panel, https://<IP or domain>:8443

2. Click on 'Domains' option in 'Hosting Services'.

3. Search for the domain you want to change login password. (Let it be example.com)

4. Login to Control Panel of the selected domain.

5. Select Account >> My Profile >> General

6. You can see the account name and an option to change password in 'Panel Preferences' in 'General' tab.

7. Enter a strong password there and Click on OK button to make the changes in effect.

8. Verify user name and password using the given link, https://example.com:8443