Restart Apache

July 16th, 2010 admin No comments
sudo /etc/init.d/apache2 restart

Categories: apache Tags:

Edit file in gedit

July 16th, 2010 admin No comments
sudo gedit /some/path/filename.php

Categories: Ubuntu Tags:

Allow external connections to MySQL server on Plesk

May 27th, 2010 admin No comments

Comment out “skip-networking parameter” in /etc/my.cnf

Categories: mysql Tags:

Using s3sync.rb to synchronize files to/from Amazon

May 23rd, 2010 admin No comments

Examples:
———
(using S3 bucket ‘mybucket’ and prefix ‘pre’)

Put the local etc directory itself into S3

s3sync.rb  -r  /etc  mybucket:pre

(This will yield S3 keys named pre/etc/…)

Put the contents of the local /etc dir into S3, rename dir:

s3sync.rb  -r  /etc/  mybucket:pre/etcbackup

(This will yield S3 keys named pre/etcbackup/…)

Put contents of S3 “directory” etc into local dir

s3sync.rb  -r  mybucket:pre/etc/  /root/etcrestore

(This will yield local files at /root/etcrestore/…)

Put the contents of S3 “directory” etc into a local dir named etc

s3sync.rb  -r  mybucket:pre/etc  /root

(This will yield local files at /root/etc/…)

Put S3 nodes under the key pre/etc/ to the local dir etcrestore
**and create local dirs even if S3 side lacks dir nodes**

s3sync.rb  -r  --make-dirs  mybucket:pre/etc/  /root/etcrestore

(This will yield local files at /root/etcrestore/…)

Source: http://s3.amazonaws.com/ServEdge_pub/s3sync/README.txt

Categories: Amazon Tags:

Create .htaccess file on a WAMP System

March 8th, 2010 admin No comments

If you are creating a new passwd file:

 C:\wamp\bin\apache\Apache2.2.11\bin\htpasswd.exe -c passfile username

If your are editing and existing password file:

 C:\wamp\bin\apache\Apache2.2.11\bin\htpasswd.exe passfile username

.htaccess contents:

AuthType Basic
require valid-user
Satisfy all
AuthUserFile C:/webroot/passwdfile
AuthName "My Secret Folder"

Move the created pass file to the desired location. and add a .htaccess file to the folder you want to protect and then gracefully restart apache.

This is done through the wamp system tray icon.

Categories: .htaccess Tags:

Easily find or search files or directories

February 26th, 2010 admin No comments

To search the current directory and all subdirectories for a folder or file, use the following command:

find . -name filename

Source: http://www.tech-recipes.com/rx/976/unixlinux-easily-find-or-search-files-or-directories/

Categories: unix / linux Tags:

Extract list of email accounts from Plesk that have a mailbox and no redirect

February 13th, 2010 admin No comments
SELECT mail.mail_name, domains.name
FROM domains
LEFT JOIN mail ON domains.id = mail.dom_id
LEFT JOIN DomainServices ON domains.id = DomainServices.dom_id
WHERE mail.postbox =  'true'
AND mail.mail_group =  'false'
AND DomainServices.type =  'mail'
AND DomainServices.status =  '0'

Categories: plesk Tags:

Create .htaccess restricted login

December 9th, 2009 admin No comments

Go here http://tools.dynamicdrive.com/password/

Categories: .htaccess Tags:

Grep UID in Plesk from Qmail log

December 4th, 2009 admin No comments

Click on the header link in the mail server queue:

Received: (qmail 30501 invoked by uid 10077); 3 Dec 2009 21:47:42 -0500
Date: 3 Dec 2009 21:47:42 -0500
Message-ID: <20091204024742.30498.qmail@hostserver.com>
To: email@domain.com
Subject: This is a test.
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: <user@domain.com>

It says its invoked by uid 10077 which corresponds to the account on the /etc/password file:

-bash-3.2# more /etc/passwd | grep 10077
username:x:10077:2522::/var/www/vhosts/domain.com:/bin/false

Categories: plesk, unix / linux Tags:

Limit to Postini IP Range in Plesk

December 2nd, 2009 admin No comments
  • Login to Plesk and go to SYSTEM -> MODULES -> FIREWALL
  • Choose Add Custom Rule
  • Enter in a rule name
  • Choose what direction to match, in this case, incoming
  • Choose ALLOW
  • Enter in port 25
  • Leave as TCP
  • Press ADD
  • Enter in 74.125.148.0/22 in the five boxes, the fifth box being the 22 (no slash)
  • Press ADD
  • Press OK

That rule will accept Postini’s block. Then, to block the rest of the email:

  • Choose Add Custom Rule
  • Enter in a rule name
  • Choose incoming
  • Choose DENY
  • Enter in port 25 and press ADD
  • Leave the network space blank
  • Press OK

It is important that you have the rules in this order, otherwise all email will be denied. Ensure that the ALLOW is above the DENY in the display list when you are done, then commit the changes.

Source: http://www.experts-exchange.com/OS/Linux/Q_24418022.html

Categories: plesk Tags: