Plesk: command to reconfigure one site
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
a christian web developer’s random writings
Archive for the ‘Linux Administration’ Category.
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
$ openssl genrsa -out ca.key 1024
$ openssl req -new -key ca.key -out ca.csr
$ openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
For the explanation, here’s the source: OpenSSL: How To Create Self-Signed Certificate
$ awksqldump dbname.dump.sql tblname
#!/bin/bash
### check parameter
E_NO_ARGS=65
if [ $# -eq 2 ]
then
# Outputs string of specified table only
awk "/Table structure for table .$2./,/UNLOCK TABLES/{print}" $1 > $1.EXTRACTED.sql
elif [ $# -eq 3 ]
then
# Outputs string starting from table1 and ends on beginning of table2
awk "/Table structure for table .$2./,/Table structure for table .$3./{print}" $1 > $1.EXTRACTED.sql
else
echo "Awk Sql Dump
Usage: awksqldump dumpfilename tablename1 [tablename2]
"
exit $E_NO_ARGS
fi
rsync -avz -e ssh root@i095.indigo.fastwebserver.de:/var/www/vhosts/philippinedev.com/httpdocs/ /srv/www/vhosts/philippinedev.com/httpdocs/
DirectoryIndex alternative-default-home-page.php
<?php
$result = exec('traceroute ' . $_SERVER["REMOTE_ADDR"], $lines);
echo '<h1>Your IP is ' . $_SERVER["REMOTE_ADDR"] . '</h1>';
echo '<pre>';
foreach ($lines as $n => $line) {
if ($n) echo '<br />';
echo $line;
}
echo '</pre>';
echo '<p>-end-</p>';
Here’s how the resulting page looks like: reverse-traceroute.php
RedirectMatch 301 (.*)$ http://www.newdomainhere.com$1
Save this into .htaccess and upload on the root directory on your old domain.
$ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd
This command will replace all instances of ‘replaceme’ with ‘newstring’ in files ‘*.php’ on /home/mysite/httpdocs.
find /home/mysite/httpdocs -name '*.php' | xargs replace 'replaceme' 'newstring' --