Archive for the tag 'server'

Step 1 Add your admin user to the ‘wheel’ group so that you will be able to ’su -’ to root, otherwise you may lock yourself out of root.

Adding user to the wheel group.

usermod -g wheel username

Edit /etc/ssh/sshd_config file.

vi /etc/ssh/sshd_config

Next, find the line PermitRootLogin yes and Uncomment it and make it look like PermitRootLogin no

Now restart SSH

/etc/rc.d/init.d/sshd restart

Installing your SSL Certificate / Web Server Certificate / Secure Server Certificate in Ensim

Your certificate will be sent to you by email after you get that from SSl providers. The email message includes the web server certificate that you purchased in the body of the email message.

Copy the certificate from the body of the email and paste it into a text editor (such as notepad) to create text files. Name this file yourdomain.txt and save it in a convenient place.

These instructions apply for both Ensim Pro and Ensim 3.x.

1. Click SSL Settings - access to this link may differ depending on your version of Ensim:

If you are running Ensim Pro. In the shortcuts section of the Home page, click SSL Settings in the Web Server section:

Or if you are running Ensim 3.x, click the Services link on the left, then click the Edit button for the Apache Web Server service:

2. Then in the Apache Web Server Manager click the SSL Settings link.

Select Import at the bottom of the SSL Settings form.

3. Copy the contents of yourdomain.txt and paste it into the Certificate text box
Be sure to include —–BEGIN CERTIFICATE—– through —–END CERTIFICATE—–

4. Select Save.
5. To make security effective on your domain, restart the Web server. The domain is not secure until you do so.

Test your certificate by using a browser to connect to your server. Use the https protocol directive (e.g. https://your server/) to indicate you wish to use secure HTTP. Note: The padlock icon on your browser will be displayed in the locked position if your certificates are installed correctly and the server is properly configured for SSL.

.htaccess Hotlink protection for files on your server.

You can stop others from hotlinking your site’s files by placing a file called .htaccess in your Apache site root (main) directory. The period before the name means the file is hidden.

Example: Your site url is www.mysite.com. To stop hotlinking of your images from other sites and display a replacement image called nohotlink.jpe placed in your images directory, place this code in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/blockhotlink.jpe [L]

The first line of the above code begins the rewrite. The second line matches any requests from your own mysite.com url. The [NC] code means “No Case”, meaning match the url regardless of being in upper or lower case letters. The third line means allow empty referrals. The last line matches any files ending with the extension jpeg, jpg, gif, bmp, or png. This is then replaced by the blockhotlink.jpe file in your images directory. This JPEG image is using the extension jpe instead of jpg to prevent blocking your own replacement image.

SBDavid

Internal Server Error with cgi files

Internal Server Error with cgi files

This means that the cgi script did not execute properly. There are several causes that can generate this error so a few things would need to be checked.

1) check the /var/log/httpd/suexec_log. It contains any errors that would be as a result of not having correct permissions on the file.

2) The file needs to be in a cgi-bin and must have the owner/group as the username who owns the site.

3) The script must have execute permission.

4) The most common chmod permission is 755.

5) The easiest way to figure out script coding problems is to first run the script manually from an ssh prompt.

6) Other errors that would be generated when running the script manually from ssh would be missing perl modules.

7) Cpan is the easiest method to install new perl modules, eg:

perl -e shell -MCPAN
install Bundle::DBD::mysql

Enable SpamAssassin on your DirectAdmin server

To enable Spamassassin on your server, you need to first need to install it. Once installed a few minor changes are needed in your /etc/exim.conf file.

1) Install spamd and spamc:

cd /usr/local/directadmin/scripts
./spam.sh

2) Start the spamd

/usr/bin/spamd -d -c -m 15

Source : http://directadmin.com

« Prev - Next »