Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th October 2006, 20:21
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Apache 2 and PHP

I have been beating my head against the wall for 12 hours, I can't figure out how I screwed up the php in my Apache2.... PHP4 and Apache2 are installed, using the perfect setup for debian - see page 5 (http://www.howtoforge.com/perfect_setup_debian_sarge_p5)

The problem is, apache does not seem to recognize the php file as something it needs to process, it just tries to send the php file directly to the browser.

I had PHP5 installed and removed it, installed PHP4 using above method... there was nothing in the /etc/apache2/mods-available/ as far as php4.load or php4.conf, but the files php5.load and php5.conf were there, i cp'd them to php4.conf & .load and changed the content so they said 4 instead of 5... then made a sym link from mods-avail to mods-enabled for them and restarted apache2 .... nothing....


how would I completely remove all traces of apache, apache2, php4, php5 and do a clean install without redoing the whole box? it is like 50 miles away from me and is being used as a company fileserver (samba) and I was going to create an intranet for them, but just cant get php to work right...

it is running debian sarge, also with postfix/courier, pretty much exactly the way the perfect setup lays it out, but I installed this box a long time before I ever read these tutorials...
Reply With Quote
Sponsored Links
  #2  
Old 25th October 2006, 20:25
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what i mean by clean install is remove all traces of the previous installs, as apt-get remove leaves behind a lot of things...

My logic is: If I could successfully remove it all, then when I do the perfect install (p5) it should work correctly..?
Reply With Quote
  #3  
Old 26th October 2006, 08:10
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I really screwed up.

I did apt-get --purge remove on everything I could think of, and still had issues, so I went and rm /usr/sbin/apache* as well as php and exim

I mistakenly thought that this would erase the installations... WRONG. it just made damn sure good that I could never reinstall any of those. well actually, apt-get --reinstall install actually did appear to reinstall apache, but it was still missing some vital pieces.

I guess what I really was trying to do was to clear the installs and configs and the apt cache so that it would all reinstall smoothly using the tutorial here, but now I just have a screwed up box. The samba is still running on it at least.

anyone have any suggestions?
Reply With Quote
  #4  
Old 26th October 2006, 08:13
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Can you just install apache* and php4 or 5 (don't know what's in the howto, but I would just install apache2, e.g. and mod_php4 or 5, the dependencies should come bye it own).
Then you could upload the httpd.conf + the include confs of php...
Reply With Quote
  #5  
Old 26th October 2006, 08:25
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
server:~# apt-get --reinstall install apache2
Reading Package Lists... Done
Building Dependency Tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 33.5kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 ftp://mirrors.usc.edu stable/main apache2 2.0.54-5sarge1 [33.5kB]
Fetched 33.5kB in 2s (14.8kB/s)
(Reading database ... 42855 files and directories currently installed.)
Preparing to replace apache2 2.0.54-5sarge1 (using .../apache2_2.0.54-5sarge1_i386.deb) ...
Unpacking replacement apache2 ...
Setting up apache2 (2.0.54-5sarge1) ...
server:~# /etc/init.d/apache2 restart
-bash: /etc/init.d/apache2: No such file or directory
server:~#
ummmn... nope...
Reply With Quote
  #6  
Old 26th October 2006, 09:10
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here was the fix:

Code:
apt-get --purge remove apache2-common
apt-get --reinstall install apache2 apache2-common apache2-doc apache2-mpm-worker apache2-utils libapr0 ssl-cert
i just went step by step through the perfect install... it errored out a few times saying it was trying to remove files that were not there, so I just touched them and then repeated it till it worked.

Reply With Quote
  #7  
Old 26th October 2006, 09:45
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well guess what?

I have reinstalled apache2 and all the modules and components, but once again, apache wants to send me the php file rather than interpret it.

Reply With Quote
  #8  
Old 26th October 2006, 10:46
kingtech kingtech is offline
Junior Member
 
Join Date: Aug 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well I figured it out... somehow I still had php5 installed...

my main problem was I had no idea how to see what packages were installed...

if you want to see them, try this:

apt-get install apt-show-versions

then

apt-show-versions | sort

will give you a nice list of installed packages...

best way to remove all traces of them is

apt-get --purge remove packagename

(I got fancy and did apt-get --purge remove php5* which removed all of em)
Reply With Quote
  #9  
Old 2nd February 2007, 21:20
R0l@ndSm0ke R0l@ndSm0ke is offline
Member
 
Join Date: Dec 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by kingtech
well I figured it out... somehow I still had php5 installed...

my main problem was I had no idea how to see what packages were installed...

if you want to see them, try this:

apt-get install apt-show-versions

then

apt-show-versions | sort

will give you a nice list of installed packages...

best way to remove all traces of them is

apt-get --purge remove packagename

(I got fancy and did apt-get --purge remove php5* which removed all of em)

Does anyone know what the SuSE versions of these commands would be? I'm having the same problem as this fella with PHP5 and Apache2 on OpenSuSE 10.2 per the Perfect OpenSuSE 10.2 setup.
Reply With Quote
  #10  
Old 3rd February 2007, 14:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,732 Times in 2,569 Posts
 
Default

On SuSE you can use
Code:
yast
to do all this.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
Slightly Confused (DNS & Server Help) JohnnyBGoode Installation/Configuration 26 14th August 2007 09:54
VirtualHosts marra87 General 9 12th September 2006 04:09
"unknown filter" growing apache log. wwparrish Installation/Configuration 6 1st September 2006 18:40
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 13th March 2006 23:58


All times are GMT +2. The time now is 13:58.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.