Tag Archives: Linux

Pureftpd (Ubuntu / Debian)

Setting up Pure ftpd to run on certains port is very simple.
Log on to you linux box and run this command:

echo “60010 60030” > /etc/pure-ftpd/conf/PassivePortRange
/etc/init.d/pure-ftpd restart

or if you run mysql as a backend

/etc/init.d/pure-ftpd-mysql restart

Now you just need to forward port 60010 to 60030, to you linux box.

Debian packages cpio failes to be updated

If you have some troubles upgrading cpio, it returns this error:

Preparing to replace cpio 2.6-18 (using …/cpio_2.6-18.1+etch1_i386.deb) …
Unpacking replacement cpio …
Replaced by files in installed package tar …
dpkg: error processing /var/cache/apt/archives/cpio_2.6-18.1+etch1_i386.deb (–u npack):
unable to create `./usr/share/locale/ko/LC_MESSAGES/cpio.mo’: No such file or d irectory
Errors were encountered while processing:
/var/cache/apt/archives/cpio_2.6-18.1+etch1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Try to run this commands:

mkdir -p /usr/share/locale/ko/LC_MESSAGES
mkdir -p /usr/share/locale/gl/LC_MESSAGES
mkdir -p /usr/share/locale/ru/LC_MESSAGES
mkdir -p /usr/share/locale/tr/LC_MESSAGES
mkdir -p /usr/share/locale/sv/LC_MESSAGES
mkdir -p /usr/share/locale/zh_CN/LC_MESSAGES
mkdir -p /usr/share/locale/da/LC_MESSAGES
mkdir -p /usr/share/locale/nl/LC_MESSAGES

And then the update should be working just fine

Tweaking mySQL in Debian

This guide is not complete to tweak you mySQL on Debian systems, because a good tweak is depending on what you want to use mySQL to.

Key Buffer:
The key buffer holds the indexes of tables in memory, and of cause a bigger key buffer result in faster row lookups. The bigger this value is the better is it, but preventing swaping. good rule of thumb seems to be to use 1/4 of system memory. key_buffer = 256M

Query Cache:
query_cache_size, as the name say it is the total memory available to query caching. query_cache_limit is the maximum number of kilobytes one query may be in order to be cached. If you set this value to high it will prevent a lot of small query to be cached. Setting it to low will prevent bigger query to be cached.
query_cache_size = 128MB
query_cache_limit = 4MB

Table Cache:
If you application need to open a lot of tables, a important variable is table_cache, it is the number of tables a thread can keep open at the same time.
table_cache = 512

The InnoDB Engine:
Allmost everybody do not use InnoDB engine I mySQL, there are using MyISAM istead. Mysql reserved memory for InnoDB, so you could easy skip this Add skip-innodb to you my.cnf file.

Binary Logging:
If you don’t want to replicate data changes to a second server, and don’t use the binary logging as incredimental backup, you can disable this feature.
Comment out this line:
log_bin = /var/log/mysql/mysql-bin.log

[ad]

Apache and multiple SSL virtual host on same IP address

In standard way, apache only supports one SSL virtual host per IP address, if you want to use different SSL Certificates file. But with mod-gnutls it is possible to have multiple Virtual host with different SSL Certificates file.

Install mod-gnutls in Debian:

apt-get install libapache2-mod-gnutls

Then you need to enable mod-gnutls

cd /etc/apache2/mods-enabled
ln -s ../mods-available/gnutls.* .

Then you need to create the gnutls cache files

touch /var/cache/apache2/gnutls_cache
chmod 700 /var/cache/apache2/gnutls_cache
chown 33.33 /var/cache/apache2/gnutls_cache

And then you need to setup the two virtualhost:

<VirtualHost *:443>
ServerAdmin [email protected]
ServerName v1.dalbjerg.nu
DocumentRoot /var/www/v1.dalbjerg.nu
GnuTLSEnable on
GnuTLSPriorities NORMAL
GnuTLSCertificateFile /etc/apache2/v1/ssl.crt
GnuTLSKeyFile /etc/apache2/v1/ssl.key
</VirtualHost>

<VirtualHost *:443>
ServerAdmin [email protected]
ServerName v2.dalbjerg.nu
DocumentRoot /var/www/v2.dalbjerg.nu
GnuTLSEnable on
GnuTLSPriorities NORMAL
GnuTLSCertificateFile /etc/apache2/v2/ssl.crt
GnuTLSKeyFile /etc/apache2/v2/ssl.key
</VirtualHost>

Then you need to restart apache

apache2cl restart

If it don’t work see at /var/log/apache2/error.log to see any error is reporting there.

[ad]

Opgraderingen til Apache 2 fra Apache 1.3 og danske bogstaver

Jeg har her til aften opgraderet en webserver fra Apache 1.3 til 2.0, herefter var alle danske bogstaver rettet af alle muligt mærkelige tegn.
Dette kan nemt rettes i apache2.conf filen, som ligger i /etc/apache2/apache2.conf (I hvert fald hvis du kører Debian).

Her skal du finde linien:
# AddDefaultCharset ISO-8859-1
Og så rette den til
AddDefaultCharset ISO-8859-15 (Forskellen på ISO-8859-1 og ISO-8859-15 er at € tegnet er med.)

Herefter skal apache genstartes dette gøres med ”apache2ctl restart”

Problems with apt-get in Debian (NO_PUBKEY A70DAF536070D3A1)

I got this error:

W: GPG error: http://security.debian.org testing/updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: GPG error: ftp://ftp.port80.se testing Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems

This can be resolve but typing:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1
gpg --armor --export A70DAF536070D3A1 | apt-key add -

Arcserve (Brightstor) Linux behind Windows Arcserve R12

We have upgraded a Arcserve (Brightstor) R11.5 to version R12. But behind this one there was install some R11.1 Linux agents. We have been told by CA Support that R12 support R11.1 linux clients. That can maybe be true, but not in our setup. We need to upgraded the R11.1 to R11.5. There is not yet a R12 Agent to Linux out there.

R11.5 can be download from CA Trials page: http://www.ca.com/trials, but remember that you need a R11.5 license.

[ad]

Grep .gz files on linux

I was looking to a method to search a lot of .gz files through. It was some logfiles, you can use zgrep to do this.
Example:
zgrep ‘Search word’ /path/to/yours.gz

So I do this to search a lot of gz files through:
Zgrep ‘130.226.165.XXX’ /var/log/apache2/access*.gz

If you just want to cat a single gz file, you can use zcat.
Zcat /var/log/apache2/access.log.52.gz

Vmware Server 1.0.5-80187 on Ubuntu 8.04

I have some trouble install vmware-mui on my Ubuntu 8.04.

I got it fix, doing this:

ln -s /usr/lib/vmware-mui/lib/libcrypto.so.4 /lib/libcrypto.so.4
ln -s /usr/lib/vmware-mui/lib/libssl.so.4 /lib/libssl.so.4
ln -s /usr/lib/vmware-mui/lib/libcrypto.so.4 /lib/libcrypto.so.4

And after that i edit /etc/init.d/httpd.vmware
And go line 256.

I change so that vmware_exec “Starting httpd.vmware:” vmware_start_httpd is call over 2 lines se above. And also vmware_exec  “Shutting down http.vmware: ” vmware_stop_httpd this i change to 2 lines.

# See how we were called.
case “$1” in
start)
#vmware_exec “Starting httpd.vmware:” vmware_start_httpd
echo “Starting httpd.vmware:”
vmware_start_httpd
;;
stop)
#vmware_exec  “Shutting down http.vmware: ” vmware_stop_httpd
echo “Shutting down http.vmware: ”
vmware_stop_httpd
;;