Plesk test directory

Community support for Plesk, CPanel, WebMin and others with insight from two of the founders of Plesk. Ask for help here! No question is too simple or complicated. :-)
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Plesk test directory

Unread post by faris »

Has anyone written a bash script that will locate and delete all the stupid "test" directories that Plesk used to set up on all domains by default?

If you have, would you be willing to share it? I don't want to re-invent the wheel and I'm not the world's greatest bash expert :-)
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: Plesk test directory

Unread post by prupert »

Skeleton for new virtual hosts can be found at:
/usr/share/plesk-vhost/htdocs/index.html
/var/www/vhosts/.skel/0/httpdocs/index.html

Set your own templates there, I would say preferably nothing more than a plain index.html.

Default virtual host (if not set explicitly per IP) can be found at:
/var/www/vhosts/default/htdocs/

Removing existing references to port 8880 from annoying default skeleton files. This is a must if you have closed this port in the firewall and are using ASL:

Code: Select all

# httpdocs
echo "Replacing javascript reference to port 8880 in vhost index.html pages"; echo "Number of matches on $HOSTNAME: `grep -l ":8880/javascript" /var/www/vhosts/*/httpdocs/index.html | wc -l`"; for filename in `grep -l ":8880/javascript" /var/www/vhosts/*/httpdocs/index.html`; do echo $filename; echo "Default index.html" > $filename; done
# legacy httpsdocs
echo "Replacing javascript reference to port 8880 in SSL-vhost index.html pages"; echo "Number of matches on $HOSTNAME: `grep -l ":8880/javascript" /var/www/vhosts/*/httpsdocs/index.html | wc -l`"; for filename in `grep -l ":8880/javascript" /var/www/vhosts/*/httpsdocs/index.html`; do echo $filename; echo "Default index.html" > $filename; done
# remove reference from templates
sed -i 's/8880/80/g' /var/www/vhosts/default/htdocs/index.html
sed -i 's/8880/80/g' /usr/share/plesk-vhost/htdocs/index.html
sed -i 's/8880/80/g' /var/www/vhosts/.skel/0/httpdocs/index.html
Lemonbit Internet Dedicated Server Management
Post Reply