Gentoo Blog

The ultimate Gentoo Blog
  • Home
  • About

Happy Christmas

Simon | December 25, 2011

I wish all Linux users our there a happy Christmas have a great one. Keep on using Linux and have a happy new year

Share on Facebook
Comments
No Comments »
Categories
fun, news
Comments rss Comments rss
Trackback Trackback

Activate Webdav in Plesk

Simon | December 8, 2011

The Plesk interface does not support the webdav protocol. But Apache does support webdav. Webdav can be used as an iDisk under MacOS X. Webdav can also be used with Linux or Windows. Here are the steps to get webdav up and running. These instructions should work on Debian based system. But similar commands should work with all major Linux distributions:

First activate the webdav Apache modules and restart apache:

a2enmod dav
a2enmod dav_fs
service apache2 restart

Then create a vhost config for the domain you are using adding webdav. Please replace domain.tld with you domain. And check the directory line:

vi /var/www/vhosts/domain.tld/conf/vhost.conf

<Directory /var/www/vhosts/domain.tld/httpdocs>
DAV on
</Directory>

To get Plesk to include our custom configuration we must reconfigure the domain with the httpdmng.

/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain domain.tld

This will make Plesk include the file vhost.conf in our Apache configuration adding the webdav directive.

You should be able to connect to the web share (webdav) now. Using the user name and password of the domain user in Plesk. You can either use the MacOS X finder (connect to server). Or you can also connect through most Linux desktops using Nautilus for example. If you experience any problems writing to the share. You may need to change the permissions on the folder so that the Apache user has write permissions:

chown -R www-data:www-data /var/www/vhosts/domain.tld/httpdocs/

Thats it you have created your own web share.

Share on Facebook
Comments
No Comments »
Categories
confixx/Plesk
Comments rss Comments rss
Trackback Trackback

OpenDNS Server

Simon | November 16, 2011

Google’s Public DNS Servers in case you need a public uncensored DNS server you can use these:

8.8.8.8
8.8.4.4

Here is my resolv.conf with the open DNS servers:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 94.75.228.2
nameserver 80.237.196.2

The last two are also open DNS Servers but not from Google.

Share on Facebook
Comments
No Comments »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Plesk Change PHP Admin Values and Rebuild Vhost Config

Simon | November 15, 2011

Create a file called “vhost.conf” in the directory “/var/www/vhosts/example.com/conf/”

<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_value safe_mode off
php_admin_flag register_globals on
</Directory>

Rebuild the domain config for the particular vhost with:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain example.com

Or rebuild all vhosts if you changed more than one with:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

You can also change other settings this way here are some examples:

php_admin_value post_max_size 20M
php_admin_value upload_max_filesize 20M
php_admin_value open_basedir none

Share on Facebook
Comments
No Comments »
Categories
confixx/Plesk
Comments rss Comments rss
Trackback Trackback

Ubuntu 11.10 Oneiric Ocelot Get your minimize and maximize buttons back

Simon | November 15, 2011

Get your minimize and maximize buttons back:

Fire up gconf-editor, then edit the following key:

desktop > gnome > shell > windows > button_layout

Then, in the right pane, edit the button_layout value to something like

:minimize,maximize,close

Thats it your done you should now see the minimize and maximize buttons again.

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Plesk panel 404 /relay after upgrade

Simon | November 4, 2011

After upgrading a plesk install yesterday. From 10.1 to 10.3.1 the admin panel started redirecting me from myserver.com:8443 to myserver.com:8443/relay. Which resulted in a 404 error with no plesk panel. During the upgrade plesk must have activated the sso component which stopped the webinterface from working. To fix this issue do the following:

/usr/local/psa/bin/sso --disable

Share on Facebook
Comments
No Comments »
Categories
confixx/Plesk
Comments rss Comments rss
Trackback Trackback

Update a Mysql password field with an MD5 string

Simon | October 12, 2011

One of our servers had a database with quite a lot of ftp users using there username as there password. To get rid of that problem i did the following. Make sure to backup you databases first. Now find out how many users there are with userid=passwd.

This select will show you which users have a userid field equal to the passwd field not a good idea.

select * from ftpuser where userid=passwd;

This update statement will update all of these users and set a random MD5 string as there password.

update ftpuser set passwd=MD5(RAND()) where userid=passwd;

This will only work with clear text passwords.

Share on Facebook
Comments
No Comments »
Categories
mysql
Comments rss Comments rss
Trackback Trackback

frequently used SSL commands

Simon | October 11, 2011

generate a new private key and matching Certificate Signing Request (eg to send to a commercial CA)
openssl req -out MYCSR.csr -pubkey -new -keyout MYKEY.key

-add -nodes to create an unencrypted private key
-add -config if your config file has not been set in the environment

decrypt private key

openssl rsa -in MYKEY.key >> MYKEY-NOCRYPT.key

generate a certificate siging request for an existing private key

openssl req -out MYCSR.csr -key MYKEY.key -new

generate a certificate signing request based on an existing x509 certificate

openssl x509 -x509toreq -in MYCRT.crt -out MYCSR.csr -signkey MYKEY.key

create self-signed certificate (can be used to sign other certificates)

openssl req -x509 -new -out MYCERT.crt -keyout MYKEY.key -days 365

sign a Certificate Signing Request
openssl x509 -req -in MYCSR.csr -CA MY-CA-CERT.crt -CAkey MY-CA-KEY.key -CAcreateserial -out MYCERT.crt -days 365

-days has to be less than the validity of the CA certificate

convert DER (.crt .cer .der) to PEM

openssl x509 -inform der -in MYCERT.cer -out MYCERT.pem

convert PEM to DER

openssl x509 -outform der -in MYCERT.pem -out MYCERT.der

convert PKCS#12 (.pfx .p12) to PEM containing both private key and certificates

openssl pkcs12 -in KEYSTORE.pfx -out KEYSTORE.pem -nodes

add -nocerts for private key only; add -nokeys for certificates only

convert (add) a seperate key and certificate to a new keystore of type PKCS#12

openssl pkcs12 -export -in MYCERT.crt -inkey MYKEY.key -out KEYSTORE.p12 -name "tomcat"
check a private key

openssl rsa -in MYKEY.key -check

add -noout to not disclose the key

check a Certificate Signing Request

openssl req -text -noout -verify -in MYCSR.csr

check a certificate

openssl x509 -in MYCERT.crt -text -noout
check a PKCS#12 keystore

openssl pkcs12 -info -in KEYSTORE.p12

check a trust chain of a certificate

openssl verify -CAfile MYCHAINFILE.pem -verbose MYCERT.crt

-to check for server usage: -purpose sslserver
-to check for client usage: -purpose sslient

Share on Facebook
Comments
No Comments »
Categories
confixx/Plesk, Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Mount a Linux NFS Share on Windows 7

Simon | August 2, 2011

First you need to install the windows nfs client. Go to

Control Panel\All Control Panel Items\Programs and Features

Then click on Turn Windows features on or off then select NFS Services Client for NFS. After the installation start a dos box or power shell. And enter the following command to mount the share backup on server 192.168.1.1 and assign the drive letter k:

mount \\192.168.1.1\backup k:

Example: mount [options] \\nfs-server-unc-name\share-name [drive letter]

Share on Facebook
Comments
No Comments »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Extracting a Database From a mysqldump File

Simon | August 2, 2011

Restoring a single database from a full dump is pretty easy, using the mysql command line client’s –one-database option:

mysql -u root -p --one-database db_to_restore < fulldump.sql

But what if you don’t want to restore the database, you just want to extract it out of the dump file? Well, that happens to be easy as well, thanks to the magic of sed:

sed -n '/^-- Current Database: `test`/,/^-- Current Database: `/p' fulldump.sql > test.sql

You just need to change “test” to be the name of the database you want extracted. Or you can use this shell script:

Download mysqldumpsplitter

Usage:

$>sh MyDumpSplitter.sh
Usage: sh MyDumpSplitter.sh DUMP-FILE-NAME — Extract all tables as a separate file from dump.
sh MyDumpSplitter.sh DUMP-FILE-NAME TABLE-NAME — Extract single table from dump.
sh MyDumpSplitter.sh DUMP-FILE-NAME -S TABLE-NAME-REGEXP – Extract tables from dump for specified regular expression.

Further instructions for using this script can be found here:

Mysql dump-shell script

Share on Facebook
Comments
No Comments »
Categories
Gentoo, mysql, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

« Previous Entries

 

January 2012
M T W T F S S
« Dec    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

  • confixx/Plesk
  • fun
  • Gentoo
  • iptables
  • mysql
  • news
  • Raid Controllers
  • Stuff
  • Ubuntu/Debian
  • Xen/Vmware

Links

  • Gentoo
  • http.net
  • iphone software linux
  • michael-fuchs.net
  • Ubuntu
  • webupd8.org

Search Blog

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox