Contents enable ssl mode and mcrypt force ssl for phpmyadmin & increase session timeout setup ldap authentication php script for ldap/active directory authentication
sudo a2enmod sslenable ssl mode for default virtual host
sudo a2ensite default-sslenable mcrypt extension for php5
sudo php5enmod mcryptrestart the service for changes to take effect
sudo service apache2 restartThat is it. Enjoy secure browsing on port 443
sed -i 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 7200/g' /etc/php5/apache2/php.inifor Ubuntu 16 the php directory has been changed so
sed -i 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 7200/g' /etc/php/7.0/apache2/php.iniedit the config file
nano /etc/phpmyadmin/config.inc.phpnow paste the following at the end of the config file
$cfg['ForceSSL'] = true; $cfg['LoginCookieValidity'] = 7200;now restart the apache service and you are all done
/etc/init.d/apache2 restartGo Up
apt-get install php5-ldapenable ldap module
a2enmod authnz_ldapsetup secure directory
cat << EOT >> /etc/apache2/apache2.conf # ldap authnow edit theAuthName "AD authentication" AuthBasicProvider ldap AuthType Basic AuthLDAPGroupAttribute member AuthLDAPGroupAttributeIsDN On AuthLDAPURL ldap://dc1.domain.com:3268/ou=users,dc=domain,dc=com?sAMAccountName?sub?(objectClass=*) AuthLDAPBindDN cn=username,dc=domain,dc=com AuthLDAPBindPassword Scc0untA123 require ldap-group cn=wacs,ou=groups,dc=home,dc=nt EOT
apache2.conf
configuration file and adjust the values of domain accordingly
nano /etc/apache2/apache2.confsave and exit our of
/etc/apache2/apache2.conf
service apache2 restartAnd you are done. Enjoy !
1) break; echo "Go UpYou are accessing ". $info[$i]["sn"][0] .", " . $info[$i]["givenname"][0] ."
\n"; echo '
(" . $info[$i]["samaccountname"][0] .")'; var_dump($info); echo ''; $userDn = $info[$i]["distinguishedname"][0]; } @ldap_close($ldap); } else { $msg = "Invalid email address / password"; echo $msg; } } else { ?>
sed -i 's/memory_limit = 128/memory_limit = 200/g' /etc/php/7.0/apache2/php.ini sed -i 's/post_max_size = 128/post_max_size = 200/g' /etc/php/7.0/apache2/php.ini sed -i 's/upload_max_filesize = 2/upload_max_filesize = 200/g' /etc/php/7.0/apache2/php.ini