Thursday, January 31, 2013

reset root password of mysql

If you are getting problem ins accessing mysql using root because you forgot password and getting below error.

error snapshot-
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES/NO)

Than  you can reset the root password using below.

"sudo dpkg-reconfigure mysql-server-<version-number>"

OR

/usr/bin/mysqld_safe --skip-grant-tables &
mysql --user=root mysql
update user set password=PASSWORD("mynewpassword") where User='root';
 
"with --skip-grant-table" it will allow root access without password.

Thursday, January 24, 2013

The 403 Forbidden error troubelshooting- Apach2

1- Check for URL errors and make sure you're specifying an actual web page file name and extension, not just a directory. Sometimes configuration may be to disallow directory browsing so a 403 Forbidden message when trying to display a folder instead of a specific page.

2- Clear the browser cookies etc.

3- A 403 status code indicates that the client cannot access the requested resource. It means the wrong username and password were sent in the request, or that the permissions on the server do not allow what was being asked.(If user level restrictions enabled/configured in .htaccess etc)

4- No default directory index page is present. Upload Index.html or Index.htm file. Directive DirectoryIndex defines the default index page name. Open your apache configuration file, find out default index file name, and upload the same file to directory:
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

5- Make sure the CGI script requested have executable permissions set on files.

6- Make sure you have permission to use .htaccess file for Apache web server. If Apache has overrides disabled than apache will bump back with a 403 error.

7- Make sure correct directory permissions are set on directory:
Alias /alias_name  /path_to_webdir

<Directory "/alias_name">
        Options +Indexes FollowSymLinks +ExecCGI
        AllowOverride AuthConfig FileInfo
        Order allow,deny
        Allow from all
</Directory>

8- Make sure the underlying file system permissions allow the User/Group under which Apache is running to access the necessary files.Execute permission on directories so that to go through the directories.


Friday, January 18, 2013

Transparent setting of terminal is not showing actual windows

if the transparent settings in terminal just shows the desktop background and not the actual windows that are opened behind the terminal just fire below command

gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true

and check the progress of running tasks without switching application windows.

Friday, January 4, 2013

perl CGI Hello world troubelshooting

To configure Apache2 with perl please make change in httpd.conf as below.

1- LoadModule cgid_module modules/mod_cgid.so
    Above module must be enabled.
2- Alias name for the directory containing the CGI script must be defined.
    ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
3- Below part of httpd.con should be like it.
<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
    Order allow,deny
    Allow from all
</Directory>
(Don't know arcane details of above; but it works)
4- Tell the extension to web server by adding below.
 AddHandler cgi-script .cgi .pl
 (You can add other extensions too)

Problem- Source code is being displayed by web browser.
Solution-  You have not enabled below line (first step)
LoadModule cgid_module modules/mod_cgid.so

Problem- While accessing the URL, output has been sent to download instead of displaying properly by web browser.
Solution- Please make sure that vary first line to STDOUT is "print "Content-type: text/html\n\n"; "

Output format may vary as per requirement but take care of "\n\n".