Create a file with your host IP or IPs and named it something like
/etc/privaterelay
Insert the IPs you'd like to give relaying priveleges to:
192.168.0.2
192.168.3.4
Next, located the following entry at the top of the /etc/exim.conf file:
hostlist relay_hosts = lsearch;/etc/relayhosts : \
localhost
and change it to this:
hostlist relay_hosts = lsearch;/etc/relayhosts : \
localhost : lsearch;/etc/privaterelay
That should do it!
Wednesday, March 5, 2008
What PHP modules does WHM/cPanel support?
The following PHP Modules are supported by cPanel/WHM at time of writing :
Bc Math
Calendar Support
Curl (Version 7.15.3)
Curl SSL Support (Version 2.8.28)
Dom XSLT
Exif
Flash
FTP
GD (Version 2.0.15)
GetText
Iconv (experimental)
Imap Module (Version 2004g)
Java (must already be installed, or install will fail)
Mb String
Mcrypt (Version 2.5.7)
Memory Limit (experimental)
Mhash (Version 0.8.18)
Ming Support (Not Recommended due to various problems) (Version 0.3beta1)
Magic Quotes
MM Session Module (Version 1.3.1)
Mysql Module
SNMP
Openssl Support
Discard Path
PDFlib (requires license for commerical use; see www.pdflib.com/pdffiles/PDFlib-Lite-license.pdf)
Pear
Postgresql (will break 7.2.x or earlier, please make sure you have 7.3.x or later installed)
Pspell Module
Sablot XSLT [may cause problems with chili!asp]
SafeMode
Sockets
Use System Mysql
Track Vars
Freetype Support
Versioning
WDDX
XML RPC
Zip
Zlib
Bc Math
Calendar Support
Curl (Version 7.15.3)
Curl SSL Support (Version 2.8.28)
Dom XSLT
Exif
Flash
FTP
GD (Version 2.0.15)
GetText
Iconv (experimental)
Imap Module (Version 2004g)
Java (must already be installed, or install will fail)
Mb String
Mcrypt (Version 2.5.7)
Memory Limit (experimental)
Mhash (Version 0.8.18)
Ming Support (Not Recommended due to various problems) (Version 0.3beta1)
Magic Quotes
MM Session Module (Version 1.3.1)
Mysql Module
SNMP
Openssl Support
Discard Path
PDFlib (requires license for commerical use; see www.pdflib.com/pdffiles/PDFlib-Lite-license.pdf)
Pear
Postgresql (will break 7.2.x or earlier, please make sure you have 7.3.x or later installed)
Pspell Module
Sablot XSLT [may cause problems with chili!asp]
SafeMode
Sockets
Use System Mysql
Track Vars
Freetype Support
Versioning
WDDX
XML RPC
Zip
Zlib
cPanel/WHM - Rebuilding Apache with easyapache
A common problem for most webhosts is that the server configuration needs to be changed to fit the needs of their clients. One big example of this is the plethora of PHP modules available that various people use to get things to work for their individual websites. In this article, the art of recompiling Apache web server to include these necessary PHP modules will be explained. Please be advised that Apache webserver will be down while it is recompiling
cPanel has a very handy script that will do all the recompiling for you, you just have to tell it how in a text menu. The script is called easyapache and it is available on your server in the /scripts directory. type in /scripts/easyapache to begin
When the script begins, you will be presented with a menu of what to do to get apache recompiled. Although option 6 is for 'advanced' users, it is the most helpful as you have more control over what PHP modules you will have on your server. After you have selected option 6, you will be presented with a menu with a blue background. Make sure only the following are checked (use enter or the spacebar) before proceeding:
X Expires Modules
X Raise FD_SETSIZE
X Prevent Users.... Webroots
X FrontPage
X Raise HARD_SERVER_LIMIT
X Report Build Errors
X ReWrite Module
X SSL Module
X suEXEC Module
X Verbose Build
Now, you will want to highlight "PHP Modules" and press enter, you will be presented with a bunch of different versions of PHP. Select the newest one for the major release you are currently using (4.4.x versus 5.2.x) and scroll down to select PHP Modules. The following list is fairly comprehensive, be sure not to select any modules labelled as "experimental":
BC Math
Calendar Support
Curl
Curl SSL Support
Dom XSLT
Exif
Flash
FTP
GD
GetText
Imap
MB String
MCrypt
MHash
Magic Quotes
MM
Mysql Module
OpenSSL Support
Discard Path
Pspell
Pear
Sablot XSLT
Sockets
Track Vars
Freetype Support
WDDX
XML RPC
ZLib
After you have selected all of the modules, highlight exit and press enter to get out of the PHP menu, and press enter on exit again. You will be asked if you want the current apache config to be backed up. It is ususally good to say yes here. Then, the script kicks off and begins recompiling apache.
When the script is all finished (usually takes about 30 minutes), you can verify the Apache version, PHP version, and installed PHP modules using the following three commands:
/etc/init.d/httpd fullstatus
php -v
php -m
Source: faq.cpanel.net
cPanel has a very handy script that will do all the recompiling for you, you just have to tell it how in a text menu. The script is called easyapache and it is available on your server in the /scripts directory. type in /scripts/easyapache to begin
When the script begins, you will be presented with a menu of what to do to get apache recompiled. Although option 6 is for 'advanced' users, it is the most helpful as you have more control over what PHP modules you will have on your server. After you have selected option 6, you will be presented with a menu with a blue background. Make sure only the following are checked (use enter or the spacebar) before proceeding:
X Expires Modules
X Raise FD_SETSIZE
X Prevent Users.... Webroots
X FrontPage
X Raise HARD_SERVER_LIMIT
X Report Build Errors
X ReWrite Module
X SSL Module
X suEXEC Module
X Verbose Build
Now, you will want to highlight "PHP Modules" and press enter, you will be presented with a bunch of different versions of PHP. Select the newest one for the major release you are currently using (4.4.x versus 5.2.x) and scroll down to select PHP Modules. The following list is fairly comprehensive, be sure not to select any modules labelled as "experimental":
BC Math
Calendar Support
Curl
Curl SSL Support
Dom XSLT
Exif
Flash
FTP
GD
GetText
Imap
MB String
MCrypt
MHash
Magic Quotes
MM
Mysql Module
OpenSSL Support
Discard Path
Pspell
Pear
Sablot XSLT
Sockets
Track Vars
Freetype Support
WDDX
XML RPC
ZLib
After you have selected all of the modules, highlight exit and press enter to get out of the PHP menu, and press enter on exit again. You will be asked if you want the current apache config to be backed up. It is ususally good to say yes here. Then, the script kicks off and begins recompiling apache.
When the script is all finished (usually takes about 30 minutes), you can verify the Apache version, PHP version, and installed PHP modules using the following three commands:
/etc/init.d/httpd fullstatus
php -v
php -m
Source: faq.cpanel.net
Manually Migrating SSL Certificates between Apache and IIS
Usually, the only time when you will have to migrate an SSL certificate for a domain by hand is when one server is running apache and the other is running IIS. In this article, we will cover moving certificates back and forth between the servers. The key point to remember is that Apache ususally keeps the certs in a plaintext file protected by the OS, and IIS uses its own password protection to store a certificate.
In reality a certificate always contains the cert itself, and an associated key called the Private RSA Key. Both are necessary for the certificate as a whole to work properly.
1. Converting a plaintext certificate into a password-protected .pfx file for use in importing into IIS
In order to convert the plaintext password, we will need to combine the key with the cert as I discussed earlier. A good naming convention is www.domain.com.key and www.domain.com.crt. You will want to combine these two files into a .pem file. You can do this using OpenSSL on any Linux server running apache. Enter the following commands
cat www.domain.com.key www.domain.com.crt > www.domain.com.pem <-- this combines the two files
openssl pkcsl2 -export -in www.domain.com.pem -out www.domain.com.pfx
You will be prompted twice to create a password. Rememeber this as you will need it to install the cert in IIS.
You will then have a proper .pfx file IIS can understand. Now you can transfer the certificate to your windows server. I find the best way is to use an application called OpenSCP. It is an SCP (Secure Copy Protocol) client for windows. You can use it to login to your linux server, navigate to the directory the .pfx file is located, and then transfer it.
On your windows server, open up IIS and go to Web Sites > (domain.com) > Right-Click > Properties > Directory Security > Server Certificate > Import from a .pfx file > Locate file > enter password
Your cert should be installed.
2. If you are transferring a .pfx certificate from IIS to plaintext in apache, you will have to make sure that the private key is marked as exportable. The problem is that it does not behave this way on default. I recommend always marking the private key as exportable whenever you install a certificate into IIS. Anyway, you can export the certificate .pfx file in the same manner you imported it in IIS, except the password you type in creates one you will need for later.
You can use OpenSCP again to transfer the .pfx file to the linux server. Once on the linux server, you can convert the .pfx file back into a plaintext .pem file using the proper command with OpenSSL:
openssl pkcsl2 -in www.domain.com.pfx -out www.domain.com.pem --nodes
You will be asked for the password you created when importing from IIS. Now you will have the key and cert in plaintext. Use a text editor to separate them into www.domain.com.key and www.domain.com.crt files, respectively. Then follow your control panel's instructions on how to install the certificate.
In reality a certificate always contains the cert itself, and an associated key called the Private RSA Key. Both are necessary for the certificate as a whole to work properly.
1. Converting a plaintext certificate into a password-protected .pfx file for use in importing into IIS
In order to convert the plaintext password, we will need to combine the key with the cert as I discussed earlier. A good naming convention is www.domain.com.key and www.domain.com.crt. You will want to combine these two files into a .pem file. You can do this using OpenSSL on any Linux server running apache. Enter the following commands
cat www.domain.com.key www.domain.com.crt > www.domain.com.pem <-- this combines the two files
openssl pkcsl2 -export -in www.domain.com.pem -out www.domain.com.pfx
You will be prompted twice to create a password. Rememeber this as you will need it to install the cert in IIS.
You will then have a proper .pfx file IIS can understand. Now you can transfer the certificate to your windows server. I find the best way is to use an application called OpenSCP. It is an SCP (Secure Copy Protocol) client for windows. You can use it to login to your linux server, navigate to the directory the .pfx file is located, and then transfer it.
On your windows server, open up IIS and go to Web Sites > (domain.com) > Right-Click > Properties > Directory Security > Server Certificate > Import from a .pfx file > Locate file > enter password
Your cert should be installed.
2. If you are transferring a .pfx certificate from IIS to plaintext in apache, you will have to make sure that the private key is marked as exportable. The problem is that it does not behave this way on default. I recommend always marking the private key as exportable whenever you install a certificate into IIS. Anyway, you can export the certificate .pfx file in the same manner you imported it in IIS, except the password you type in creates one you will need for later.
You can use OpenSCP again to transfer the .pfx file to the linux server. Once on the linux server, you can convert the .pfx file back into a plaintext .pem file using the proper command with OpenSSL:
openssl pkcsl2 -in www.domain.com.pfx -out www.domain.com.pem --nodes
You will be asked for the password you created when importing from IIS. Now you will have the key and cert in plaintext. Use a text editor to separate them into www.domain.com.key and www.domain.com.crt files, respectively. Then follow your control panel's instructions on how to install the certificate.
Argument list too long
Some commands such as chmod, rm, and grep to name a few, can take multiple filenames as arguments rather than executing the command once per file. This can be very powerful and convenient, but there is a point at which the list of arguments actually becomes too long
There exists a command, xargs, that takes as input a list of items, and passes them individually as arguments to another command. Consider, for example, the following:
find . -name 'cgisess*' | xargs rm
What this does, in relation to the remove command, is it finds, by name (in this case anything beginning with cgisess) and executes the rm command on it. Which is different then building a list of items to remove, then removing them as is done normally with the rm command.
Further complications: Special characters in filenames
The "find | xargs rm" thing only worked correctly because none of the filenames involved had any spaces in them. If the filenames involved have spaces, you will need to do use find's "-print0" option in conjunction with xargs's "-0" option.
find . -name 'spam-*' -print0 | xargs -0 rm
There exists a command, xargs, that takes as input a list of items, and passes them individually as arguments to another command. Consider, for example, the following:
find . -name 'cgisess*' | xargs rm
What this does, in relation to the remove command, is it finds, by name (in this case anything beginning with cgisess) and executes the rm command on it. Which is different then building a list of items to remove, then removing them as is done normally with the rm command.
Further complications: Special characters in filenames
The "find | xargs rm" thing only worked correctly because none of the filenames involved had any spaces in them. If the filenames involved have spaces, you will need to do use find's "-print0" option in conjunction with xargs's "-0" option.
find . -name 'spam-*' -print0 | xargs -0 rm
Redirecting to non-SSL traffic to SSL
To make http:// or http://www. redirect to https:// or https://www. when you have an SSL certificate installed add the following lines in a .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Place the .htaccess in the htdocs directory for the corresponding site. Be careful not to overwite an existing .htaccess file.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Place the .htaccess in the htdocs directory for the corresponding site. Be careful not to overwite an existing .htaccess file.
How to generate an SSL Certificate Signing Request (CSR) in a non-paneled environment
How to generate an SSL Certificate Signing Request (CSR) in a non-paneled environment
NOTE: If you have purchased an SSL Certificate from us, we will handle everything from the certificate signing request to the installation of the signed certificate.
If you are using cPanel or Plesk, please find the proper article that will provide the instructions. If you do no have a panel installed, please continue on.
Edit openssl.cnf which should usually be located in the /usr/share/ssl directory and be sure you set the following:
Name
Company Name
City
State
Country (2 digit country code will be entered into the conf)
Email Address (must be webmaster or hostmaster @domain)
Generate the private key:
# openssl genrsa -out host.key 1024
# chmod 400 host.key
Replace 'host.key' above with domain as specified in the ticket. eg. www..com.
Generate CSR (Cetfificate Signing Request):
# openssl req -new -nodes -key host.key -out host.csr
NOTE: If you have purchased an SSL Certificate from us, we will handle everything from the certificate signing request to the installation of the signed certificate.
If you are using cPanel or Plesk, please find the proper article that will provide the instructions. If you do no have a panel installed, please continue on.
Edit openssl.cnf which should usually be located in the /usr/share/ssl directory and be sure you set the following:
Name
Company Name
City
State
Country (2 digit country code will be entered into the conf)
Email Address (must be webmaster or hostmaster @domain)
Generate the private key:
# openssl genrsa -out host.key 1024
# chmod 400 host.key
Replace 'host.key' above with domain as specified in the ticket. eg. www.
Generate CSR (Cetfificate Signing Request):
# openssl req -new -nodes -key host.key -out host.csr
Subscribe to:
Posts (Atom)
