httpd Setup for ComtelPBX

1) Edit /etc/httpd/conf/httpd.conf

a. Comment out:

'# ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

'#
'# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
'# CGI directory exists, if you have that configured.
'#
'#<Directory "/var/www/cgi-bin">
'# AllowOverride None
'# Options None
'# Order allow,deny
'# Allow from all
'#</Directory>

b. Add Virtual Host:

'######################################################################
'### Virtual Hosts
'######################################################################

NameVirtualHost *:80

'######################################################################
'### Comtel Networks, Corp.
'######################################################################

<VirtualHost *:80>
ServerName voip.comtel-networks.com
ServerAlias comtel-networks.com
DocumentRoot /www/comtel-networks/html
AccessFileName .htaccess
DirectoryIndex /cgi-bin/PBXUsers/index.pl
ErrorLog logs/error_log
<Directory "/www/comtel-networks/html">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /billing "/www/comtel-networks/html/billing"
<Directory "/www/comtel-networks/html/billing">
DirectoryIndex index.php
<Limit GET POST OPTIONS>
Options MultiViews
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ScriptAlias /cgi-bin "/www/comtel-networks/cgi-bin"
<Directory "/www/comtel-networks/cgi-bin">
DirectoryIndex index.pl
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>




2) Edit directory configuration for voicemail files and other used diretories "/etc/httpd/conf.d/directories.conf":

'##################################################################
'### Comtel Networks, Corp.
'##################################################################

<Directory "/www/comtel-networks/cgi-bin/astcc-admin/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /www/comtel-networks/cgi-bin/astcc-admin/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

<Directory "/www/comtel-networks/cgi-bin/astpp-admin/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /www/comtel-networks/cgi-bin/astpp-admin/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'###################################################################

<Directory "/www/comtel-networks/cgi-bin/Click_and_Buy/">
AuthName "IMA Admin Login"
AuthType Basic
AllowOverride AuthConfig
AuthUserFile /var/spool/asterisk/voicemail/default/1011001/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################
'### Voicemail Directories
'##################################################################
<Directory "/www/comtel-networks/html/pbxcustomers">
AuthName "PBX Management"
AuthType Basic
AllowOverride AuthConfig
AuthUserFile /var/spool/asterisk/voicemail/default/1011001/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################
'### Public Site
'##################################################################

<Directory "/var/www/pub/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /var/lib/ComtelPBX/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

'#<Directory "/var/www/html/pbxcustomers/">
'#AuthName "ComtelPBX Admin"
'#AuthType Basic
'#AllowOverride AuthConfig
'#AuthUserFile /var/lib/ComtelPBX/.htpasswd
'#Order allow,deny
'#allow from 127.0.0.1
'#require valid-user
'#Satisfy any
'#</Directory>

'##################################################################

<Directory "/var/www/html/pub/downloads/">
AuthName "Downloads Login"
AuthType Basic
AuthUserFile /var/lib/ComtelPBX/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

'#<Directory "/var/www/cgi-bin/astpp-users/">
'#Options ExecCGI
'#AuthName "User Login"
'#AuthType Basic
'#require valid-user
'#AuthMySQLEnable On
'#authMySQLHost 216.242.36.227
'#AuthMySQLUser webuser
'#AuthMySQLPassword ApacheP@ssword01
'#AuthMySQLDB billing
'#AuthMySQLUserTable ab_account
'#AuthMySQLPasswordField password
'#AuthMySQLNameField username
'#AuthMySQLPwEncryption md5
'#AuthMySQLNoPasswd Off
'#</Directory>



4) Set httpd as service and configure it to start:

chkconfig --level 3 httpd on
chkconfig --add httpd

Verify:

chkconfig -list httpd



5) Setup SSL: Edit: nano /etc/httpd/conf.d/ssl.conf. Make sure to add the follwoing overriding the default options:

<VirtualHost _default_:443>
  1. General setup for the virtual host, inherited from global configuration
ServerName voip.comtel-networks.com:443
ServerAlias comtel-networks.com:443
DocumentRoot /www/comtel-networks/html
AccessFileName .htaccess
DirectoryIndex /cgi-bin/PBXUsers/index.pl
<Directory "/www/comtel-networks/html">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /billing "/www/comtel-networks/html/billing"
<Directory "/www/comtel-networks/html/billing">
DirectoryIndex index.php
<Limit GET POST OPTIONS>
Options MultiViews
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ScriptAlias /cgi-bin "/www/comtel-networks/cgi-bin"
<Directory "/www/comtel-networks/cgi-bin">
DirectoryIndex index.pl
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/voip_comtel-networks_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/DigiCertCA.crt
</VirtualHost>



6) Install certificate files. Place the proper .key and .crt files in the directories accordingly:

SSLCertificateFile /etc/httpd/conf/ssl.crt/voip_comtel-networks_com.crt

SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

SSLCACertificateFile /etc/httpd/conf/ssl.crt/DigiCertCA.crt

Now set owner and permissions:

chown apache.root -R /etc/httpd/conf
chmod 770 -R /etc/httpd/conf
service httpd restart



Now you can work through an encrypted connection just by typing 'https://' instead of 'http://'. Enjoy your privacy!

1) Edit /etc/httpd/conf/httpd.conf

a. Comment out:

'# ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

'#
'# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
'# CGI directory exists, if you have that configured.
'#
'#<Directory "/var/www/cgi-bin">
'# AllowOverride None
'# Options None
'# Order allow,deny
'# Allow from all
'#</Directory>

b. Add Virtual Host:

'######################################################################
'### Virtual Hosts
'######################################################################

NameVirtualHost *:80

'######################################################################
'### Comtel Networks, Corp.
'######################################################################

<VirtualHost *:80>
ServerName voip.comtel-networks.com
ServerAlias comtel-networks.com
DocumentRoot /www/comtel-networks/html
AccessFileName .htaccess
DirectoryIndex /cgi-bin/PBXUsers/index.pl
ErrorLog logs/error_log
<Directory "/www/comtel-networks/html">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /billing "/www/comtel-networks/html/billing"
<Directory "/www/comtel-networks/html/billing">
DirectoryIndex index.php
<Limit GET POST OPTIONS>
Options MultiViews
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ScriptAlias /cgi-bin "/www/comtel-networks/cgi-bin"
<Directory "/www/comtel-networks/cgi-bin">
DirectoryIndex index.pl
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>




2) Edit directory configuration for voicemail files and other used diretories "/etc/httpd/conf.d/directories.conf":

'##################################################################
'### Comtel Networks, Corp.
'##################################################################

<Directory "/www/comtel-networks/cgi-bin/astcc-admin/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /www/comtel-networks/cgi-bin/astcc-admin/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

<Directory "/www/comtel-networks/cgi-bin/astpp-admin/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /www/comtel-networks/cgi-bin/astpp-admin/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'###################################################################

<Directory "/www/comtel-networks/cgi-bin/Click_and_Buy/">
AuthName "IMA Admin Login"
AuthType Basic
AllowOverride AuthConfig
AuthUserFile /var/spool/asterisk/voicemail/default/1011001/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################
'### Voicemail Directories
'##################################################################
<Directory "/www/comtel-networks/html/pbxcustomers">
AuthName "PBX Management"
AuthType Basic
AllowOverride AuthConfig
AuthUserFile /var/spool/asterisk/voicemail/default/1011001/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################
'### Public Site
'##################################################################

<Directory "/var/www/pub/">
AuthName "Admin Login"
AuthType Basic
AuthUserFile /var/lib/ComtelPBX/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

'#<Directory "/var/www/html/pbxcustomers/">
'#AuthName "ComtelPBX Admin"
'#AuthType Basic
'#AllowOverride AuthConfig
'#AuthUserFile /var/lib/ComtelPBX/.htpasswd
'#Order allow,deny
'#allow from 127.0.0.1
'#require valid-user
'#Satisfy any
'#</Directory>

'##################################################################

<Directory "/var/www/html/pub/downloads/">
AuthName "Downloads Login"
AuthType Basic
AuthUserFile /var/lib/ComtelPBX/.htpasswd
Order allow,deny
allow from 127.0.0.1
require valid-user
Satisfy any
</Directory>

'##################################################################

'#<Directory "/var/www/cgi-bin/astpp-users/">
'#Options ExecCGI
'#AuthName "User Login"
'#AuthType Basic
'#require valid-user
'#AuthMySQLEnable On
'#authMySQLHost 216.242.36.227
'#AuthMySQLUser webuser
'#AuthMySQLPassword ApacheP@ssword01
'#AuthMySQLDB billing
'#AuthMySQLUserTable ab_account
'#AuthMySQLPasswordField password
'#AuthMySQLNameField username
'#AuthMySQLPwEncryption md5
'#AuthMySQLNoPasswd Off
'#</Directory>



4) Set httpd as service and configure it to start:

chkconfig --level 3 httpd on
chkconfig --add httpd

Verify:

chkconfig -list httpd



5) Setup SSL: Edit: nano /etc/httpd/conf.d/ssl.conf. Make sure to add the follwoing overriding the default options:

<VirtualHost _default_:443>
  1. General setup for the virtual host, inherited from global configuration
ServerName voip.comtel-networks.com:443
ServerAlias comtel-networks.com:443
DocumentRoot /www/comtel-networks/html
AccessFileName .htaccess
DirectoryIndex /cgi-bin/PBXUsers/index.pl
<Directory "/www/comtel-networks/html">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /billing "/www/comtel-networks/html/billing"
<Directory "/www/comtel-networks/html/billing">
DirectoryIndex index.php
<Limit GET POST OPTIONS>
Options MultiViews
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ScriptAlias /cgi-bin "/www/comtel-networks/cgi-bin"
<Directory "/www/comtel-networks/cgi-bin">
DirectoryIndex index.pl
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/voip_comtel-networks_com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SSLCACertificateFile /etc/httpd/conf/ssl.crt/DigiCertCA.crt
</VirtualHost>



6) Install certificate files. Place the proper .key and .crt files in the directories accordingly:

SSLCertificateFile /etc/httpd/conf/ssl.crt/voip_comtel-networks_com.crt

SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key

SSLCACertificateFile /etc/httpd/conf/ssl.crt/DigiCertCA.crt

Now set owner and permissions:

chown apache.root -R /etc/httpd/conf
chmod 770 -R /etc/httpd/conf
service httpd restart



Now you can work through an encrypted connection just by typing 'https://' instead of 'http://'. Enjoy your privacy!

Created by: mglucksmann, Last modification: Fri 14 of Sep, 2007 (01:52 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+