Snewzzer Posted May 17, 2011 Share Posted May 17, 2011 Hi I have inherited some code which has been placed on a new LAMP server, intended to replace an ageing system.The code uses the $_SERVER['REMOTE_USER'] variable but when ran through the Webrowser doesn't work. phpinfo() reveals that the $_SERVER['REMOTE_USER'] variable does not exist. It does exist though on the server where the code originally comes from. My problem is how to enable the use of $_SERVER['REMOTE_USER'] on this newly built server. Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/ Share on other sites More sharing options...
fugix Posted May 17, 2011 Share Posted May 17, 2011 check this out here. they list a few things to try Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216478 Share on other sites More sharing options...
Snewzzer Posted May 18, 2011 Author Share Posted May 18, 2011 Thanks Fugix but went through this thread yesterday and couldn't make much sense of it. I am new to PHP, Apache, Linux, MySQL. Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216877 Share on other sites More sharing options...
jonsjava Posted May 18, 2011 Share Posted May 18, 2011 You need an .htaccess file first. A basic .htaccess file, for testing purposes: .htaccess AuthName "restricted stuff" AuthType Basic AuthUserFile /etc/.htpasswd require valid-user Place that file in the folder that you are wanting protected (or the root of the site, if you want ALL things protected) next, run this: htpasswd -c /etc/.htpasswd user1 it will ask for a password for user1 (change the user to the username you want to use) for all other users, do this: htpasswd /etc/.htpasswd user2 htpasswd /etc/.htpasswd user3 etc... Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216883 Share on other sites More sharing options...
Snewzzer Posted May 18, 2011 Author Share Posted May 18, 2011 Sorry, I should have given more detail. The Webpage loads automatically without a username and password as long as the logged in user is a member of the required Windows Active Directory group. Therefore I do not need to set a password for each user as your method describes as AD takes care of this. We are trying to make an exact duplicate of an existing system onto a new server, as this is how the original system works. Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216913 Share on other sites More sharing options...
jonsjava Posted May 18, 2011 Share Posted May 18, 2011 as mentioned in my PM to you, you need the PHP-LDAP extension installed, and apache restarted. Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216914 Share on other sites More sharing options...
Snewzzer Posted May 18, 2011 Author Share Posted May 18, 2011 Yes jonsjava, PHP LDAP was installed and apache restarted. Thanks for keep coming back to me. I have progressed to this point :- The following line needs to be added to the apache2.conf file ... LoadModule ntlm_winbind_module /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so But when added apache would not restart.. cannot find file mod_auth_ntlm_winbind. Searched further and came across the following instruction on how to install it ... #autoconfig ./configure apxs2 -DAPACHE2 -c -i mod-auth_ntlm_winbind.c Had to install autoconfig first with apt-get install autoconfig but now when trying to run above command I get ... autoconfig error no input file Pretty much drawing a blank from then on. Quote Link to comment https://forums.phpfreaks.com/topic/236631-_serverremote_user/#findComment-1216993 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.