Postgres Install

Here’s a quick and easy way to install postgres:

Download the postgres install files and extract them.  Then cd into the primary directory and run:

./configure
gmake
gmake install
groupadd postgres
adduser -g postgres -d /home/postgres postgres
passwd postgres
mkdir /home/postgres/data
chown postgres. /home/postgres/data
su – postgres
/usr/local/pgsql/bin/initdb -D /home/postgres/data
/usr/local/pgsql/bin/postmaster -D /home/postgres/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

 

Domains That Point To Your Dns

It happens all the time, web hosting clients terminate their account but they leave their domain pointing to your dns.  Unfortunately this can cause a burden on your servers because their domain still points to your nameservers even though they aren’t hosting their website with you.  This can be a little controversial, however if you’re going to host their dns and answer requests then you should benefit from the responses and traffic.  This command works well in cpanel, however you may have to adjust it for other systems:

cat /var/log/messages | grep named | grep denied | cut -d “‘” -f2 | cut -d “/” -f1 | sort | uniq -ci | sort -nr

Basically what this does is search the messages file for the terms named and denied and then it sorts through the results.  This should provide you with a list of domains that are no longer in your DNS, according to cpanel, however the domain still points to your nameservers.  If a domain has a lot of results I would suggest adding the domain back into your DNS and pointing it to the IP of your website.  This will allow you to profit from the traffic and links that are still active.

Note – you have to run this command as root from your nameservers.  If you fail to run it as root or if you run it from a server that doesn’t handle DNS you won’t receive usable results.

 

 

Courier: Max Connections per IP

Here’s how you can increase the maximum number of courier connections on a cpanel server:
The two config files that you need to edit are:

/etc/courier-imap/imapd
/etc/courier-imap/pop3d

Open each of the files and search for: “MAXPERIP” The default is usually 4, however you can set it to a higher limit and then be sure to restart your courier service.

/etc/init.d/courier-imap restart

 

Install image magick

1.- Download the file ImageMagick-cnc1.tar.gz

Code:

cd /usr/local
wget http://r1.cnc1.net/ImageMagick-cnc1.tar.gz

2.- Untar the file:
Code:

tar -zxvf ImageMagick-cnc1.tar.gz

The program will be installed in /usr/local/magick, the default way to invoke the program will be:

/usr/local/magick/bin/convert

However if you like to just use just “convert” instead of writing the whole path:

3.- Soft link to a directory included in path (normaly /usr/bin or /bin):

Code:

ln -s /usr/local/magick/bin/convert /bin/convert

 

Hsphere disable wget in the file manager

vi  /hsphere/shared/apache/htdocs/webshell4/com.ini

change:

wget=1

to:

wget=0

 

Hsphere change your control panel port

http://www.psoft.net/HSdocumentation/sysadmin/changing_cp_url.html

Changing hsphere control panel ports from:

Too may firewalls blocking it:
8443 – 2087
8080 – 2086

First move apache to 2086 and 2087
vi /etc/httpd/conf/httpd.conf
Change:
Listen 0.0.0.0:80
to
Listen 0.0.0.0:2086

vi /etc/httpd/conf.d/ssl.conf
Change
Listen 0.0.0.0:443
to
Listen 0.0.0.0:2087

Change hsphere:
vi /hsphere/local/home/cpanel/hsphere/WEB-INF/classes/psoft_config/hsphere.properties
Change
CP_PORT = 8443
to
CP_PORT = CP_PORT = 443

Change
DEFAULT_CP_PORT = 8080
to
DEFAULT_CP_PORT = 80

Change
PATH_SITE_STUDIO = http://66.98.172.89:8080/studio/servlet/psoft.masonry.Builder
to
PATH_SITE_STUDIO = http://66.98.172.89:80/studio/servlet/psoft.masonry.Builder

Fix Site Studio:
cd /hsphere/shared/SiteStudio/psoft_config/
vi counter.properties
Change 8080 to 80 (2 times)

vi guestbook.properties
Change 8080 to 80 (1 time)

vi masonry.properties
Change 8080 to 80 (6 times)

vi /hsphere/local/home/cpanel/apache/etc/httpd.conf
Change:
Port 80

<IfDefine SSL>
Listen 8080
Listen 8443
</IfDefine>

Change:
<VirtualHost _default_:443>

Stop Apache, Stop CP
Start Both Services
================================================================================================
Once You are complete some clients still have 8080 and 8443 bookmarked – port forward to avoid errors
================================================================================================
iptables -t nat -A PREROUTING -p tcp -i eth0 -d $SERVERIP –dport 8443 -j DNAT –to $SERVERIP:443
iptables -t nat -A PREROUTING -p tcp -i eth0 -d $SERVERIP –dport 8080 -j DNAT –to $SERVERIP:80

 

Common Hsphere commands and utilities

H-Sphere Web service restart:
/etc/rc.d/init.d/httpd restart

H-Sphere Control Panel service restart:
/etc/rc.d/init.d/httpdcp restart

DNS service restart:
/etc/rc.d/init.d/named restart

Client Control Panel Login:
http://domain.com/cp

Hsphere CP Database is located at:
/var/lib/pgsql/data/base/

H-Sphere ftp service restart:
/etc/rc.d/init.d/proftpd stop
sleep 2
/etc/rc.d/init.d/proftpd start

H-Sphere mail service restart:
/etc/rc.d/init.d/qmaild stop
sleep 2
/etc/rc.d/init.d/qmaild start

Sendmail restart
/etc/rc.d/init.d/sendmail restart

MySQL service restart:
/etc/rc.d/init.d/mysqld stop
sleep 2
/etc/rc.d/init.d/mysqld start

The main H-Sphere PostgreSQL service restart:
/etc/rc.d/init.d/postgresql stop
sleep 10
/etc/rc.d/init.d/postgresql start

 

Horde disable address book sharing

First you have to locate your “sources” configuration file for turba/horder.

locate sources.pho

Open sources.php and change the following line:

‘use_shares’ => true

to:

‘use_shares’ => false

 

Protect /home from prying eyes

By default the permissions on your /home directory are usually set to 755.  This can cause serious problems with script kiddies.  If they find a vulnerable script on your server they can then list all of the users in /home.  By locking down your home folders it makes it a little more difficult for them create a list of all of the users on your server.

To lockdown the accounts we set the permissions to 751 on our home folders.

chmod 751 /home;
chmod 751 /home2;
chmod 751 /home3;

This keeps script kiddies and their prying eyes out of your user’s folders.

 

JSP Hello World

<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<H1>Hello World</H1>
Today is: <%= new java.util.Date().toString() %>
</BODY>
</HTML>

 


Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We are independently owned and the opinions expressed here are our own. Please contact us if you would like your web hosting company considered for a web hosting and support review.
Back to top Copyright 2012 © How To Host A Website, An OS Hosting, LLC Company