Apache2 Authentication with htpasswd
Create user/password file:
#htpasswd -c /var/www/example/cfg/.htpasswd example_username
Enter password
Use in .htaccess:
AuthType Basic
AuthName "Restricted Directory"
AuthUserFile /var/www/example/cfg/.htpasswd
Require user example_username
Add another user to .htpasswd file:
#htpasswd /var/www/example/cfg/.htpasswd example_user2
Create group auth file /var/www/example/cfg/.htgroup with text:
ExampleGroup: example_username example_user2
Use group access in .htaccess:
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /var/www/example/cfg/.htpasswd
AuthGroupFile /var/www/example/cfg/.htgroup
Require group ExampleGroup
Use for virtual host:
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/example
<Directory "/var/www/example">
AuthType Basic
AuthName "Restricted Directory"
AuthUserFile /var/www/example/cfg/.htpasswd
AuthGroupFile /var/www/example/cfg/.htgroup
Require group ExampleGroup
</Directory>
</VirtualHost>
Install Zend Optimizer
Download ZendOptimizer.so and move to directory on server
Add to php.ini (/etc/php5/apache2/php.ini):
zend_extension=/example/zend/ZendOptimizer.so
