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

Retrieve Plesk admin password on Windows via commandline

You can set up a new password by running the following command:


"%plesk_bin%\plesksrvclient" -set <new_password> true

You can also retrieve the current password by running this utility with:

"%plesk_bin%\plesksrvclient" -get

Wednesday 19 June 2013

Enable ssh key for cpanel users

Problem: When we need to enable ssh access to the users and if the server is only accessible via key file,

If it is a cpanel server, we can do it simply from WHM/Cpanel

make sure that enabled 'SSH Connection Window'  in the feature manager. Check both default and disabled features.

Enable jailed shell access to the user.

Login to the cpanel of the user. Main >> Security >> SSH/Shell Access >> Manage SSH Keys  >> Generate a new   .  fill the details and generate key. You have to specify a passphrase during the key generation.

Go back and go to Public Keys >> Manage Authorization  and make it as authorized . Download Private Key to your local machine and save it with permission 600. try ssh as given below
ssh -i key user@IP -p port
enter passphrase created during KeyGeneration

edquota: Quota write failed (id 526): Invalid argument

when run 
[~]# /scripts/fixquotas

will say something like;

edquota: Quota write failed (id 526): Invalid argument

so to fix it;

[~]# /sbin/quotacheck -vguma

then try again

[~]# /scripts/fixquotas

Cannot start mysql

Problem:
[~]# /etc/init.d/mysql status
ERROR! MySQL is not running, but lock exists

 [~]# /etc/init.d/mysql start
 Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/*)

Solution:

 [~]# ps aufx | grep mysql
 If it shows the mysql process, Kill that mysql process using
[~]#killall mysql

  [~]# rm -f /var/lock/subsys/mysql

 [~]# /etc/init.d/mysql start

 If still it doesnt  solve the issue,
 it may be that MySQL is not starting because it is unable to load a variable set in /etc/my.cnf.
If there are a lot of entries in your my.conf, it may be easier to mv /etc/my.cnf to something like /etc/my.cnf.old and then see if MySQL starts.

Also, check the mysql log file and see what it says. A few examples:

1.Error:

MySQL installation Error - InnoDB: Error: pthread_create returned 11 

Apply this fix :
  [~]#ulimit -s unlimited
Then start mysql again.
2.Error:





Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 

 

Apply this fix :


Go to the data directory and remove log files look like ib_logfile0, ib_logfile1 and ib_logfile2.  Then start mysql.

3.Error:
 ERROR! MySQL manager or server PID file could not be found!

Apply this fix :

Go to  /etc/my.cnf file
 Put the below in your my.cnf then try again.

skip-innodb

  This will skip the InnoDB engine on startup. If the problem is related to InnoDB, MySQL will start without InnoDB support.

Thursday 13 June 2013

Apache – “Client denied by server configuration”

Problem: You will get a 403 in your web-browser while access your site.

The error log (/usr/local/apache/logs/error_log or /etc/httpd/logs/error_log) will shows like this:
“client denied by server configuration: /path/to/files”

Then you probably have denied access to the directory in the httpd.conf file.

Allow access by adding:
<directory /path/to/files>
allow from all
</directory>

If your are using VirtualHosts then add the directory-block inside the <virtualhost> block.

Sunday 9 June 2013

/scripts/fixquotas issue in cpanel server

Problem: The quota alloted for each account seems unlimited when you check Main >> Account Information >> List Accounts from WHM. 

When run /scripts/fixquotas to correct the quotas for each website, You may get the following error.

#/scripts/fixquotas

Installing Default Quota Databases......Done
Quota Mode: Linux
journaled quota support: not available with vzaquota (disabled)
Quotas have been enabled, however they may not be up to date as quotacheck has been skipped.
Reading package *****
No filesystems with quota detected.
Resetting quota for ***** to 1024 M
Reading package *****
No filesystems with quota detected.
Resetting quota for ***** to 2048 M
Reading package *****
No filesystems with quota detected.
Resetting quota for ***** to 512 M


SOLUTION:

If it is an openvz container and you have node access you can fix it simply by doing the below steps.

1. Login to the Hardware Node containing the particular container/vps

2. Shutting down the container/vps
# vzctl stop CT_ID

3. Adding the quotaugidlimit for the VPS using the command
# vzctl set 101 --quotaugidlimit 80 --save
 Forexample here CT_ID is 101 and Disk Space for VPS is 80GB.

4. starting/mounting the container/vps
#  vzctl start CT_ID

5.  running /scripts/fixquotas
#  /scripts/fixquotas

Thats it. Please check again Main >> Account Information >> List Accounts from WHM and verify the result.