Archive for the ‘Basics’ Category

Here is a list of ports that are used commonly on ISPConfig 3 servers. If you dont have all services installed or if you e.g. dont want to connect to MySQL from external servers, then close the unused or unwanted ports.

TCP ports

20 - FTP Data
21 - FTP Command
22 - SSH
25 - Email
53 - DNS
80 - HTTP (Webserver)
110 - POP3 (Email)
143 -Imap (Email)
443 - HTTPS (Secure webserver)
993 - IMAPS (Secure Imap)
995 - POP3S (Secure POP§)
3306 - MySQL Database server
8080 - ISPConfig web interface
8081- ISPConfig apps vhost

UDP ports

53 - DNS
3306 - MySQL

The Following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System.

Ubuntu Linux

sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

Debian Linux

mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

The benefot of the above comand is that it uses the debian-sys-maint login to MySQL which is available on every Debian and Ubuntu System, so you dont have to provide the MySQL root login details.

How To Disable Error Logging For A Website In ISPConfig 3

Friday, August 8, 2014 posted by admin

To disable the error.log for a website in ISPConfig on a Apache webserver, follow this steps:

1) Login to ISPConfig

2) Go to the website settings of the website were you like to disable the error.log and there go to the "Options tab"

3) Add the following line in the field labeled "Apache Directives"

ErrorLog /dev/null

and press save:

 

How to Copy Files with SCP between Linux Servers

Saturday, July 19, 2014 posted by Till

1.1 SCP Command Line-An Overview

 

The SCP command line is commonly used to copy files over SSH, and between popular Operating systems like Linux, Mac and Windows in a secure fashion. SCP is used to copy files to/from a remote server. It also allows you to copy files from one remote server to another remote server, without passing traffic through your PC.

Solution for: system-config-firewall: command not found

Wednesday, February 5, 2014 posted by admin

When you get the error message "system-config-firewall: command not found" on your CentOS Server while trying to configure the firewall on the shell, then the text interface version of the firewall configuration utility is missing. Install it with this command:

yum install system-config-firewall-tui

Incorrent Time on Windows/Linux Dual Boot System

Monday, April 22, 2013 posted by CSch

If you work on a dual boot system you might experience that when you log off from Windows, onto Linux, and to Windows again, the time that is shown in the bottom right corner might be an hour or more off the actual time. This will correct once you refresh it by loading the time from a time server again but will remain an issue for the next logins.
This has not directly to do with daylight savings or an incorrect time zone, but most likely with Linux assuming that the BIOS time is set to UTC while it's set to local time. So it just changes the BIOS clock according to that. Logging in to Windows with the wrong BIOS clock will result in a wrong system time.

This Linux behavior can easily be changed though, so just login to your Linux system and open a command line. First log in as root with your password:

sudo su

Then enter following to open the rcS file (note that I use vi as text editor - you can use any other you like here):

vi /etc/default/rcS

Now look for the line reading UTC = yes and change it to UTC = no. Save the file and try to boot into Windows - if every other time setting is set correct you should get the right time now.

The following guide shows how to disable and remove mysql replication from two or more mysql servers. These steps can be used for master/slave and master/master mysql setups. The following SQL commands have to be be executed in phpmyadmin or with the mysql commandline program. It is just important that you are logged in as mysql root user. Below I will use the mysql commandline client.

Login into mysql as root user from commandline:

mysql -u root -p

the mysql command will ask for the mysql root password.

Then execute these commands if the installed mysql version is < 5.5.16:

STOP SLAVE;
RESET SLAVE;
QUIT

use the commands below instead if the mysql version is > 5.5.16

STOP SLAVE;
RESET SLAVE ALL;
QUIT

Now edit the my.cnf file (/etc/mysql/my.cnf) and add a # in front of all lines that start with "replicate-" or "master-". Example:

# replicate-same-server-id = 0
# master-host = 192.168.0.105
# master-user = slaveuser
# master-password = akst6Wqcz2B
# master-connect-retry = 60

Then restart mysql:

/etc/init.d/mysql restart

 

Rotating screen in Ubuntu and Linux Mint

Wednesday, November 7, 2012 posted by CSch

Just as in Windows you have the option to rotate your screen into any direction in Linux, too. While in Windows you only need to press some keys, a key combination is not configured in Linux by default. But as you may have figured out, there are some terminal commands that let you do the exact same thing (you can configure shortcuts for these manually later on).

First, you need to find out how the screen that you want to rotate is labeled - to do that, use the following command:

xrandr -q

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.1*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

You will get a list of connected monitors - I have only one here which is labeled LVDS1, it says connected next to the name. Determine the one that you want to rotate here. Next, we want to turn it around. For that, we use one of the following commands:

xrandr --output LVDS1 --rotate right
xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate inverted
xrandr --output LVDS1 --rotate normal

Replace LVDS1 with your monitor label in the above commands and you'll be able to rotate the screen to your likings! This is especially helpful if you need to go through documents and can turn your physical monitor around.

Here is a short script that helped me to copy files that have ben modified within the last 60 minutes to a new directory. The script uses a combination of the find and cp commands, it has to be run inside the directory that contains the new files.  In this example, I will copy all files that have been modified within the last 60 minutes from /var/www to the directory /var/newfiles, you can replace the timespan or target directory in the script to match your reqzúirements.

First, enter the /var/www directory which contains the files:

cd /var/www

Then execute this command to find the latest files and copy them to /var/newfiles:

find ./ -type f -mmin -60  -exec cp -pf {} /var/newfiles/ \;

 

 

Read ext4 partitions from Windows 7

Thursday, October 25, 2012 posted by CSch

Linux partitions are usually not visible under Windows operating systems. While it's not recommended to write on a Linux partition from Windows, you can read files from there without too much of a great danger. However, a tool is needed for that - an example for that is DiskInternals Linux Reader.

You can download the reader at DiskInternals' homepage: http://www.diskinternals.com/linux-reader/

To browse the files on the Linux filesystems, you need to install the application and browse them through it - they're not shown in the Windows explorer as the other hard disks and partitions are. Download the application and follow the installer to correctly install it. You'll find an overview of all the available file systems listed:

To read or save files to a Windows system, just double- or right-click the item and select the appropriate action!