Hi all.
I have an apache web-server set up (on Windows server 2003) with PHP and mySql. Someone a few years ago developed a simple intranet site, which we access internally. The website is working fine, and it has login page, where it creates a session checked against the mySql database. Succesful logins get to see the pages of the intranet, unsuccesful logins get displayed a notice.
Recently it was decided to split the intranet into 2 departments, as they have some info that should not be shared.
I do not know much about php/mysql/apache, but I think I get the gist of how everything works.
So what I did, I simply copied ALL the files on the htdocs directory on a new htdocs2, created a new virtual host and added it to the httpd.conf (before it was only intranet.company.com, I added intranet.company2.com), and edited the login (.php file) on the intranet2 so that it only accepts people from company2. Then I went and edited the necessary files/logos etc so that company2 has its own information on it.
Both pages are working fine, I can login to each separately, and i can view the pages, and it displays an error message if failed login
However, on intranet.company2.com, I can also manually type in intranet.company2.com/"internalpagename.php" and it will let me in. If I try that on the intranet.company.com it will simply redirect me to the login page (if I have not logged in previously).
Can anyone point me to where I need to look?
All the php logins/classes etc are the same (except for the username check, basically a "where" clause), and I configured both pages the same on the httpd.conf file
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.x
Allow from domain.com
</Directory>
<Directory "C:/Program Files/Apache Group/Apache2/htdocs2">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.x
Allow from domain.com
</Directory>
ServerRoot "C:/Program Files/Apache Group/Apache2"
<VirtualHost *:80>
ServerName intranet.company.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
UseCanonicalName ON
</VirtualHost>
<VirtualHost *:80>
ServerName intranet.company2.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs2"
UseCanonicalName ON
</VirtualHost>
I have an apache web-server set up (on Windows server 2003) with PHP and mySql. Someone a few years ago developed a simple intranet site, which we access internally. The website is working fine, and it has login page, where it creates a session checked against the mySql database. Succesful logins get to see the pages of the intranet, unsuccesful logins get displayed a notice.
Recently it was decided to split the intranet into 2 departments, as they have some info that should not be shared.
I do not know much about php/mysql/apache, but I think I get the gist of how everything works.
So what I did, I simply copied ALL the files on the htdocs directory on a new htdocs2, created a new virtual host and added it to the httpd.conf (before it was only intranet.company.com, I added intranet.company2.com), and edited the login (.php file) on the intranet2 so that it only accepts people from company2. Then I went and edited the necessary files/logos etc so that company2 has its own information on it.
Both pages are working fine, I can login to each separately, and i can view the pages, and it displays an error message if failed login
However, on intranet.company2.com, I can also manually type in intranet.company2.com/"internalpagename.php" and it will let me in. If I try that on the intranet.company.com it will simply redirect me to the login page (if I have not logged in previously).
Can anyone point me to where I need to look?
All the php logins/classes etc are the same (except for the username check, basically a "where" clause), and I configured both pages the same on the httpd.conf file
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.x
Allow from domain.com
</Directory>
<Directory "C:/Program Files/Apache Group/Apache2/htdocs2">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 192.168.x
Allow from domain.com
</Directory>
ServerRoot "C:/Program Files/Apache Group/Apache2"
<VirtualHost *:80>
ServerName intranet.company.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
UseCanonicalName ON
</VirtualHost>
<VirtualHost *:80>
ServerName intranet.company2.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs2"
UseCanonicalName ON
</VirtualHost>