| Total Items: | |
| SubTotal: | |
| Tax Cost: | |
| Shipping Cost: | |
| Final Total: |
Kamis, 21 Januari 2010
Virtual Host in Apache
Virtual Host in Apache
You have a static public IP to use for multiple domains such as www.rab.co.id, jabber.rab.co.id, and debian.rab.co.id. Let's just say the site will be built using Drupal and PostgreSQL. # Apt-get install phppgadmin
In this way participate Apache installed. Then activate the module virtual host:
# A2enmod vhost_alias
Add on / etc/apache2/apache2.conf:
ServerAdmin grananda@rab.co.id
AllowOverride All
Now create / etc/apache2/sites-available/www.rab.co.id:
ServerName www.rab.co.id
DocumentRoot / home / vhost / www.rab.co.id / htdocs /
ErrorLog / var/log/apache2/www-error.log
CustomLog / var/log/apache2/www-access.log combined
Then switch the site:
# Www.rab.co.id a2ensite
# / Etc/init.d/apache2 restart
Do the same for other domains.
Apache as Proxy
Now, other examples may be appropriate for your situation. You have another machine on the LAN that contains electrical voucher system where you only have 1 public IP is. Though voucher system allows members to fill pulses through the web. Apache here can be used as a proxy that will forward the request to the machine's browser vouchers. Say http://192.168.0.17 http://mgl.rab.co.id means for Apache. I hope you understand what he meant.
Must first activate the module:
# A2enmod proxy_http
Then make / etc/apache2/sites-available/mgl.rab.co.id:
ServerName mgl.rab.co.id
ErrorLog / var/log/apache2/mgl-error.log
CustomLog / var/log/apache2/mgl-access.log combined
ServerSignature On
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://192.168.0.17/
ProxyPassReverse / http://192.168.0.17/
Order deny, allow
Allow from all
Daemon restart it:
# / Etc/init.d/apache2 restart
Default Site
Sometimes visitors do not write like http://rab.co.id www prefix, and maybe some that directly mention the fun with its IP http://202.59.201.67. We can make Apache led demand that is not listed in the virtual host to http://www.rab.co.id by making / var / www / index.php:
DNS
Before doing this make sure the domains are already registered in Bind (DNS). Without this Apache configuration will not work.
SSL
You have a site for the member. It is time to enable SSL to avoid eavesdropping activities.
First create the certificate file:
# Apt-get install ssl-cert
# Make-ssl-cert / usr / share / ssl-cert / ssleay.cnf / etc / ssl / private / apache.pem
Activate the module:
# A2enmod ssl
Edit / etc/apache2/sites-available/default with initial lines to be like this:
NameVirtualHost *: 80
..
Then copy to its SSL version:
# Cp / etc/apache2/sites-available/default / etc/apache2/sites-available/default-ssl
and edit / etc/apache2/sites-available/default-ssl be:
NameVirtualHost *: 443
SSLEngine on
SSLCertificateFile / etc / ssl / private / apache.pem
..
Enable:
# Ln-s / etc/apache2/sites-available/default-ssl / etc/apache2/sites-enabled/000-default-ssl
Do also change in / etc/apache2/sites-available/www.rab.co.id:
..
ServerName www.rab.co.id
DocumentRoot / home / vhost / www.rab.co.id / htdocs /
CustomLog / var/log/apache2/www-ssl-access.log combined
ErrorLog / var/log/apache2/www-ssl-error.log
SSLEngine on
SSLCertificateFile / etc / ssl / private / apache.pem
Restart Apache:
# / Etc/init.d/apache2 restart
Then try using the browser by giving the prefix https like https: / / www.rab.co.id.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar