|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Apache downloading the source code
Hello;
I have a strange problem, I already installed Apache/MySQL/PHP4.0.3pl1 on my server and every thing is working well which does not have a domain name. the Apache was installed using prefix=/www I decided to change the configuration of my Apache from the main server to virtual host configuration, then I went to place where the source files I used for installing apache and followed the steps for another static compilation for the php module as follow: cd apache/source/dir ./configure --prefix=/www1 --activate-module=src/modules/php4/libphp4.a make make install then I uncommented the two AddType lines in the httpd.conf file AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 and copied the whole directory of my site to a new directory /www1/htdocs/testdir directory and configured my virtual host to be NameVirtualHost * VirtualHost * ServerAdmin URL DocumetnRoot /www1/htdocs/testdir ServerName *.mydomain.com ErrorLog /www1/htdocs/testdir/admin/logs/error_log CustomLog /www1/htdocs/testdir/admin/logs/access_log Options -Indexes FollowSymLinks MultiViews /VirtualHost and I changed the port to 8080 and added the files index.php index.php3 to the DirectoryIndex directive In short this file is the same of the file used in the already working configuration except what I mentioned above. The problem is when I point my browser to myip:8080 the page named index.html is displayed, and when I point to myip:8080/index.php3 the page is parsed correctly and displayed but when I point to the file myip:8080/index.php (not php3) then my browser is prompting me for downloading the file and the source code of my program will be displayed which is a big security problem Then I tried to add the extentions on one line like this: AddType application/x-httpd-php .php .php4 .php3 But the problem does exists. Then I searched my httpd.conf for any other instances but I did find no additional references then I Created .php3 with phpinfo(); for the both servers but the apache configuration is the same except what ever related to pathes www1 instead www and port 8080 instead of 80 and except the following line: in the default port server: PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/myusername/bin in the 8080 port server: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin while there is no /home/myusername/bin at all. Then I copied my index.php file to another file name, SURPRISED it worked. Then I tried to add another extention which is foo and php4 and the result is: All other extention tried and was working but still index.php not working and displaying the download prompt. A very strange/may be useful notice is that: when I browse for my index.php at the port 8080 the download prompt will apear and if I downloaded the file, SURPRISE the file is not the index.php under the tree of the server working at port 8080 but it is the index.php file in the tree of the server running on the default port !!!!!!!!!!!!!!!!!!!!!!!!! Then I supposed the problem is coming from the Directoryindex directive, then I tried to remove index.php and index.php3 from both configurations, and after restarting both the servers the same problem is still existing ??!!!??!!!!!!!!!! Then I supposed the problem was in the virtualhost directive then I corrected to be like this: VirtualHost *:8080 and restarted but the problem does exists. Then I tried to change it to be VirtualHost myip:8080 and restarted, but the problem does exists I feel this is a back door or other kind of bugs existing in the whole apache/mod_php4 Another note I found that all other files with php extention in any other directory other than DocumentRoot is working Please any comments? |
|
#2
|
|||
|
|||
|
Have you tried looking at the Apache error log and access log?
__________________
The real n-tier system: FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL Amazon wishlist -- rycamor (at) gmail.com |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Apache downloading the source code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|