Archive for May, 2010

How do I change default language for AWStats?

Languages for AWStats are defined by “Lang” directives in it’s configuration files. New languages need to be set in the main AWStats configuration files.

/etc/awstats/awstats.conf
/etc/awstats/awstats.model.conf

The files which are already configured by Plesk for every domain can be found in the following files (Be sure to replace mt-example.com with your domain name):

/usr/local/psa/etc/awstats/awstats.serverbuddies.com-http.conf
/usr/local/psa/etc/awstats/awstats.serverbuddies.com-https.conf

By default Lang is set to Lang=”auto”, this means it will accept the first available language by the browser. You can change it to any supported value that can be found above the Lang directive in the configuration files.

For example, if you want English you would use the following:

Lang=”en”

When you are finished making any changes be sure to restart awstats to see any changes instantly.

Reference: http://parallels.com

Understanding basic vi (visual editor)

Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.

Vim behaves differently, depending on the name of the command (the executable may still be the same file).

vim The “normal” way, everything is default.

ex Start in Ex mode. Go to Normal mode with the “:vi” command. Can also be done with the “-e” argument.

This first line is just to simply open a file with vi:

vi file-name

The following command is used to recover a file that was being edited when the system crashed:

vi -r file-name

The next command will open a file as read-only:

vi ew file-name

To move around in the editor

type h to type move the cursor to the left
type l to move it to the right
type k to move up
type j to move down

To search within VI

To search for text in vi you can use the “/” key followed by your search term. This example uses buddy:

/buddy

To quit and not save changes you can use:

:q!

If you want to quit and save changes you can use the following command:

:x!

Reference : man vi command line

How can I change/repair my Admin account if the password in Plesk?

Unable to connect to database
login.php3: Unable to connect to database: Permission denied
ERROR 1045: Access denied for user: ‘admin@localhost’ (Using password: YES)

First try to restart Parallels Plesk Panel:

# /etc/init.d/psa restart

Check that the /etc/psa/.psa.shadow file has valid permissions. The right permissions would be

# ls -la /etc/psa/.psa.shadow
-rw——- 1 psaadm psaadm 5 Feb 26 11:22 /etc/psa/.psa.shadow

In case you have any other permission, you should change it using the following command:

# chown psaadm:psaadm /etc/psa/.psa.shadow
# chmod 600 /etc/psa/.psa.shadow

Check that Mysql server is running and working properly using the “ps ax | grep mysql” command. For example:

# ps ax | grep mysql

To check that Mysql server is running fine, try to access to the mysql console. For example:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa

In the newest versions of Parallels Plesk Panel, the password can be restored using the “ch_admin_passwd” utility.

# /usr/local/psa/admin/sbin/ch_admin_passwd –help

To change the password, use a command like the following one:

# export PSA_PASSWORD=’NEW_PASSWORD’ ; /usr/local/psa/admin/sbin/ch_admin_passwd; unset PSA_PASSWORD

Load MySQL with ’skip-grant-tables’ option, adding skip-grant-tables to the [mysqld] section of /etc/my.cnf file

Restart MySQL with the following command prompt:

# /etc/init.d/mysqld restart

Add the new password to the /etc/psa/.psa.shadow file.

Repair the password using the following command prompt:

# /usr/bin/mysql -D mysql -e”update user set password=PASSWORD(’`cat /etc/psa/.psa.shadow`’) where User=’admin’;”

Delete skip-grant-tables option from /etc/my.cnf

Restart MySQL.

Reference: http://parallels.com/

SSI doesn’t seem to be working in Plesk. How can I determine what the problem is?

# Make sure that SSI is enabled for the domain within the Plesk interface. This can be enabled/disabled within the domain’s physical hosting screen.
# Make sure that the file has the proper extension (by default):

.shtml

# Make sure that the file has the proper ownership. The owner should be domain_ftp_user and the group should be psacln.
# The apache configuration file httpd.conf should contains the lines:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Look in the domain’s Apache error_log file at /var/www/vhosts/serverbuddies.com/statistic/logs/ for more information.

Reference: http://parallels.com/

SBDavid

Understanding the dig command

Understanding the dig command

dig will let you perform any valid DNS query, the most common of which are A (the IP address), TXT (text annotations), MX (mail exchanges), and NS nameservers.

The command dig is a tool for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information.

This tool can be used from any Linux (Unix) or Macintosh OS X operating system. The most typical use of dig is to simply query a single host.

$ dig serverbuddies.com
; <> DiG 9.5.1-P3 <> serverbuddies.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39970
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0

;; QUESTION SECTION:
;serverbuddies.com. IN A

;; ANSWER SECTION:
serverbuddies.com. 14043 IN A 67.228.43.85

A quick way to just get the answer only is to run the following command:

dig serverbuddies.com +short

Use the following command to get a list of all the mailservers for mt-example.com:

dig serverbuddies.com MX +noall +answer

Use the following command to get a list of authoritative DNS servers for mt-example.com:

dig serverbuddies.com NS +noall +answer

« Prev - Next »