General

From Server Knowledge Base
Revision as of 11:42, 15 January 2013 by Rootadminacc (talk | contribs) (Created page with "This page will be used for articles and non-specific information. == Operating Systems PHP, Apache, MySQL, Perl and Python Versions == {| border="1" align="center" style="te...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This page will be used for articles and non-specific information.

Operating Systems PHP, Apache, MySQL, Perl and Python Versions

Operating System PHP Apache MySQL Perl Python
Fedora Core 2 4.3.10 2.0.51 4.1.21 Unknown Unknown
Ubuntu 6.06 LTS 4.4.2 - 5.1.3 2.0.55 5.0.22 5.8.7 2.4.2
Ubuntu 8.04 LTS 5.2.4-5.2.9 2.2.8 5.0.51 - 5.0.96 5.8.8 2.5.2
Ubuntu 10.04 LTS 5.3.2 2.2.14 5.1.41-5.5 5.10.1 2.6.5
Ubuntu 12.04 LTS WIP 2.2.22+ WIP WIP WIP
CentOS 5.5/5.7 5.1.6-5.3.3-5.3.6 2.2.3 5.0.77 5.3.10 2.4.3
CentOS 6.2 5.3.3-5.4 2.2.15 - 2.2.22 5.1.52 5.8.8 2.6.6
Windows Web VPS 5.2.17 - 5.3.5 SQL 2008 R2 Express (free)

Check here to see how to check the SQL version/edition on Windows.
For CentOS PHP 5.3.3 check if you are using a 64 bit system (most likely). If so you need to use x86_64.

Check MySQL database size

SSH into your server, enter MySQL. If it uses WHM/cPanel log into WHM and go to the SQL Services menu > MySQL Root Password and set it there.

For a Plesk server:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`;

For other servers.

mysql -p

Then:

show databases;
use database
show table status;

Look at the Data_length column for each table, which is in bytes.

VNC

You can use VNC often to diagnose issues whereby you have issues logging into your server. VNC does not rely on virtual machine network connectivity as it's the equivalent of plugging a monitor/keyboard/mouse into a physical machine.

CentOS 6
Ubuntu 10.04

To VNC to a console higher then 100, simply use :60** where ** is the last 2 digits of the console number.

Several good VNC programs are mRemote, Tight VNC or RealVNC.

www to non-www

Guides for Magento: 1, 2 and 3

See second response in here as to why a Magento installation may show the IP instead of the domain name when going to your website.

Automatically restart services

Written by Leon Teale

cd /root
vim filename.sh #(e.g apachemonitor.sh)

Put the below script in it for Apache2. Replace the service in the ="apache2" field for other processes such as mysql etc.

#!/bin/bash
 limit=0
 [email protected]
 service="apache2" #or replace this with httpd
 process=`ps aux | grep "$service" | grep -v grep  | wc -l`
 if
[ "$process" -le "$limit" ] ;
 then
       if
       [ ! -f /root/apachedown ];
       then
       echo "$service is not running" | mail -s "$service" $admin
       /etc/init.d/apache2 restart #replace this with httpd
       touch /root/apachedown
       else
       /etc/init.d/apache2 restart #replace this with httpd
       fi
 else
 echo "$service is running"
       if
       [ -f /root/apachedown ];
       then
       rm /root/apachedown
       else
       echo ""
       fi
 fi

Then run:

chmod +x /root/filename.sh
crontab -e

Add into crontab -e the following:

* * * * * sh /root/filename.sh

Create an any size test file

For Virtual Private Servers:

dd if=/dev/zero of=/testfile bs=15M count=1

This also tests the write speed of the disk.

For Dedicated Servers:

dd if=/dev/zero of=/dev/null bs=1M count=32768

Empty a file

:> /file/path

This always exits true, but produces no output. Good for large old log files.

Clear your browser cache

http://support.mozilla.org/en-US/kb/clear-cache-delete-temporary-files-fix-issues
http://support.google.com/chrome/bin/answer.py?hl=en&answer=95582
http://webdesign.about.com/cs/internetexplorer/ht/htclearcacheie.htm
http://www.refreshyourcache.com/en/safari

File exceeds maximum allowed size in joomla

If you see the following image, check one of the below threads:

http://forum.joomla.org/viewtopic.php?f=431&t=660927&view=next
http://www.cmsmind.com/joomla-1-7-help-how-to-modify-the-max-image-upload-size
http://www.simplemachines.org/community/index.php?topic=246794.0

Google AdWords

Google AdWords lets you create an advert for your website and decide which Google search terms you would like to trigger your advert. When people search on Google using these terms, your advert is displayed. You pay a little out of a voucher only when someone clicks on the advert and visits your website.

Google Adsense is the opposite of this effectively.

Google Analytic's on Media Wiki

cd /var/www/vhosts/domain.com/mediawiki-install-folder/extensions
wget https://sites.google.com/site/rutisextensions/googleAnalytics.zip
unzip googleAnalytics.zip
cd googleAnalystics
chown ftpuser:psacln googleAnalytics.i18n.php googleAnalytics.php
vim googleAnalytics.php

Edit Line 19:

$wgGoogleAnalyticsAccount = "enter-GA-code-here";

Edit Line 25:

function efGoogleAnalyticsHookText($skin, &$text = '')

Exit the file.

cd /var/www/vhosts/domain.co.uk/httpdocs
vim LocalSettings.php

Add in the following at the bottom of the file:

require_once( "$IP/extensions/googleAnalytics/googleAnalytics.php" );

Then create this file.

vim analyticstracking.php

Add in the following script:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'enter-GA-code-here']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Invalid Certificate

If you receive this error in Chrome on https:

"... but the server presented an invalid certificate."

Go to Tools > Options > Under the Hood > untick HTTPS/SSL - Check for server certificate revocation

Rebuild a 123-reg VPS

1. Log in to your 123-reg control panel with your main 123-reg username and password.
2. Scroll down to the Web hosting and click the 123-reg VPS link
3. Click the Manage link
4. Click the Console tab
5. Click the "Rebuild" button to reisntall your VPS.

The process of rebuilding your container effectively restores it to original settings, erasing all data in the process. If you choose to go ahead with this course of action, I advise you take and ensure you have sufficient relevant backups to restore domains/setting/websites after the rebuild.

Current Windows OS on Webfusion VPS

  • Windows Web for Standard and Community packages
  • Windows Standard for Business and Developer packages
  • Windows Enterprise for Enterprise package

^M

If lines in a file end in ^M this normally means the file has been edited using a DOS editor. You can remove these manually or using the dos2unix utility.

Ensure /etc/passwd doesn't have dos line endings:

file /etc/passwd

/etc/passwd: ASCII text, with CRLF, LF line terminators

To fix:

dos2unix /etc/passwd
file /etc/passwd

/etc/passwd: ASCII text

apt-get upgrade option

Cloud Hosting

Cloud is good for redundancy particularly if your site is heavily hit and is quite dynamic as multiple copies of your data is spread across several servers.

PS3 Media Server

Video skipping

There are many reasons for this. See the following threads:

http://tehparadox.com/forum/f28/ps3-media-server-watch-your-1080p-mkv-movies-easy-518971/
http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=3507&start=30#p38969

A fix that worked for me was to go into C:\Program Files (x86)\PS3 Media Server\PMB.bat and edit:

start javaw -Xmx768M
#to be the following
start javaw -Xmx3072M

This allocates ~3GB of RAM to Java instead of 768MB. I would advise making a copy of the file first, make a copy of the file elsewhere and edit the value in that second copy, remove the original file and then place the second copy into the folder. This is because it will likely say the file is in use even if you stop PMS, Java, your browser and other services.

Audio out of sync

Method 1) Go into Transcoding Settings > Video/Audio decoder settings > Untick A/V sync alternative method
Method 2) Go into Transcoding Settings > Video/Audio decoder settings > Tick or untick Force framerate parsed from FFmpeg
Method 3) Option 11

Also, using .crt subtitles can cause the same issue. See: http://www.ps3mediaserver.org/forum/viewtopic.php?f=6&t=13366

Increase performance on Linux server - Not Guaranteed

apt-get update
apt-get install prelink preload

If you do not use mod_perl or mod_python on your websites, disabling these may decrease memory usage.

Random Technical Terms

More to be added.

HAC = High Availability Clustering
SAN = Storage Area Network
NAS = Network-Attached Storage
CSV = Comma-Separated Values

Character Map

Put a semi colon ; after the code below to display the arrows.

&larr = Left Arrow ←
&rarr = Right Arrow →
&uarr = Up Arrow ↑
&darr = Down Arrow ↓
&harr = Left and Right Arrow ↔
&crarr = Corner Arrow ↵

Firefox

Bookmarks location

C:\Users\user\AppData\Roaming\Mozilla\Firefox\Profiles\0aaaa0a0.default\bookmarkbackups

Add a Keyword for This Search

In Firefox you can skip a page and use a keyword to search directly from the URL bar. To set this up first right-click on the search box and choose 'Add a Keyword for This Search'. That prompts to create a bookmark; give it a name and a short keyword (such as "skb" for this site). You will then be able to search just by going to the URL bar and entering skb *space* and then for example: Plesk

Chrome

Add as a search engine

Right click the search box and click the option above. Then in the Name or Keyword box enter the prefix you want to type to initiate the search function.

Outlook Web App signature is greyed out

This happens in Google Chrome. Use Firefox or Internet Explorer to set it in Options > See All Options > Settings > Mail tab > E-mail Signature