Archive

Archive for April, 2009

Disable suexec

April 23rd, 2009 admin No comments

To find suexec type in

whereis suexec

Result

suexec: /usr/sbin/suexec /usr/sbin/suexec.saved_by_psa /usr/share/man/man8/suexec.8.gz

Now move the file to a backup

mv /usr/sbin/suexec /usr/sbin/suexec_old

Restart apache

/etc/init.d/httpd  restart

Categories: apache, unix / linux Tags:

Setup svn repo with an auto update hook

April 23rd, 2009 admin No comments

This is on a MediaTemple VPS running on CentOS 5 and is assuming you already have svn installed

So first thing is to go into the hooks folder for a particluar svn repository

cd /var/svn/website/hooks

You’ll see they all have .tmpl on the end – so the’yre all just templates

To make it active we need to remove the .tmpl
The one we want is post-commit.tmpl
So jut need to copy it to new file without the extension

cp post-commit.tmpl post-commit

So now we need to vi into it
You’ll see its full or instructions, etc.
You can just leave that
Go down to bottom
Comment out the last 5 lines, well last 2 and the 2 above

Now add two lines whever u want:

cd /var/www/vhosts/somedomain.com/subdomains/devdomain/httpdocs/  #path to website
svn up

Ok save and exit

Ok now need to make executable

chmod 755 post-committ

Now, the script needs to be owned by a user that has an svn account set up in the repo

To see list of users look in the passwd file ( /var/svn/website/conf/ )

chown username post-commit

Now u can test with

./post-commit

It might need the ownership of whoever made the working copy checkout on the server, the ones I have done I have always made the first checkout on the server so it’s always been my account.  It will give an error if it needs to be a different user ownership anyway.

Categories: svn Tags:

Load a mysql database dump via command line

April 17th, 2009 admin No comments

Run this command on the command line to load a mysql database dump file

mysql -u yourusername -p -h localhost databasename < data.sql

Categories: mysql Tags:

Transfer files from one server to another using scp

April 17th, 2009 admin No comments

Type this command on the command line to move files from one server to another

scp bkp.tar username@name_of_the_server:/emplacement_to_put_the_file

Source: http://www.webmaster-talk.com/php-forum/119073-transfer-files-from-one-server-another.html

Categories: unix / linux Tags:

How to dump a mysql database via command line

April 17th, 2009 admin No comments

Run this command to dump a database via command line

mysqldump –u yourusername –p yourdatabasename > yourdumpfile.sql

Categories: mysql Tags:

View All Email Account Passwords in Plesk

April 14th, 2009 admin No comments

Run this in the psa mysql database to see all email passwords

SELECT accounts.id, mail.mail_name, accounts.password, domains.name 
FROM domains 
LEFT JOIN mail ON domains.id = mail.dom_id 
LEFT JOIN accounts ON mail.account_id = accounts.id

Run this modified version to see just a particular domain

SELECT accounts.id, mail.mail_name, accounts.password, domains.name
FROM domains
LEFT JOIN mail ON domains.id = mail.dom_id
LEFT JOIN accounts ON mail.account_id = accounts.id
WHERE domains.name = 'somedomain.com'

Source: http://www.search-this.com/2007/02/07/view-all-email-account-passwords-in-plesk/

Categories: plesk Tags:

Remove advertising (Top News) panel Horde

April 13th, 2009 admin No comments

Linux Route

cd / usr / share / psa-horde / templates / portal
vi sidebar.inc

Comment out the following block:

/ *
if (window.NewsFeeds) (
window.NFopen = (readCookie ( 'plesk_newsfeed_visible') == 'false')? false: true;
document.write ( ") document.write ( '&lt;tbody&gt;') document.write (") document.write ( ");
document.write ( ") document.write (") document.write ( '&lt;/ tbody&gt;
&lt;? php echo _ ( 'Top News');?&gt;
&lt;a href = "javascript: NFgetList ()" class = "btn-refresh" title = "&lt;? php echo _ ( 'Refresh');&gt;&gt;
&lt;? php echo _ ( 'Refresh');?&gt; &lt;/ a&gt;
&lt;a href = "javascript: NFcollapseList ()" class = "btn-open-close" title = "&lt;? php echo _ ( 'Open / Close');&gt;&gt;
&lt;? php echo _ ( 'Open / Close');?&gt; &lt;/ a&gt;
') Document.write ('
') Document.write ('
');
if (window.NFopen &amp; readCookie ( 'horde_sidebar_expanded')! = 'false')
NFgetList ();
)
* /

Source: http://translate.google.com/translate?hl=en&ie=UTF-8&sl=es&tl=en&u=http://blogs.clavedigital.com/ncastillo/2009/02/11/quitar-publicidad-top-news-del-panel-de-horde/

Categories: plesk Tags:

svn checkout — Check out a working copy from a repository.

April 9th, 2009 admin No comments

Synopsis

svn checkout URL... [PATH]

Description

Check out a working copy from a repository. If PATH is omitted, the basename of the URL will be used as the destination. If multiple URLs are given each will be checked out into a subdirectory of PATH, with the name of the subdirectory being the basename of the URL.

Alternate Names

co

Source: http://svnbook.red-bean.com/en/1.0/re04.html

Categories: svn Tags:

How do I create a symbolic link?

April 9th, 2009 admin No comments
ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]

For example:

ln -s /usr/local/apache/logs ./logs

This points a symbolic link “./logs” to “/usr/local/apache/logs”

Source: http://help.hardhathosting.com/question.php/95

Categories: unix / linux Tags:

Process .html as PHP

April 9th, 2009 admin No comments

To setup a Linux server running Apache web server to process .html (.htm) files as PHP. create an .htaccess file in the root folder of your website and add these lines to the .htaccess file:

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

Source: http://www.lgr.ca/blog/2007/02/process-html-as-php.html

Categories: .htaccess, php Tags: