Apache2 problems on Ubuntu

iPat

Baseband Member
Messages
79
How do I get php working with Apache on Ubuntu 8.04 Live? I did:
#apt-get install apache2
#apt-get install php5

But it just prompts to download all php files in /var/www -- it sends the wrong file type. Same with image and media files. I cannot stop apache2 either. It gives an error message whenever I run the apache control command. Is there a way of editing the config file to correct the file types and then sending some sort of signal to apache to make it restart?
 
Hi,

Apache should be installed already when you install Ubuntu. I would like to see the error that you are getting when you try and install them. I would make sure that you system is up-to-date, too.

Cheers!
 
Hi,

Apache should be installed already when you install Ubuntu. I would like to see the error that you are getting when you try and install them. I would make sure that you system is up-to-date, too.

Cheers!

On ubuntu desktop 8.04? Lol? I don't believe so.
I'm running an ubuntu server and it wasn't..

You said ubuntu live.. Are you trying to do this on a live cd?!

I would suggest two things. Get 9.04 server edition, install that.
Then try and set everything up from there.
 
Wow I must be tired. I apparently need to read the entire post before I comment.
 
Haha, if i'm in a rush and need to get it installed, i just run:
Code:
sudo apt-get install phpmyadmin
That automagically get's PHP, mySQL and Apache2, and configures them.

I'm running lighttpd, myself!
 
OK so I tried
sudo apt-get install phpmyadmin --fix-missing

And it installed Apache. Perhaps also php and mysqld. But php files still don't work. The browser downloads the source code instead. Images, movies, and audio files are similarily treated incorrectly. I cannot modify the config file and restart apache, because apache refuses to restart. When I type:
apache2 -k restart

It says:
apache2: bad user name ${APACHE_RUN_USER}
-------------

EDIT:
Well I finally figured out how to stop and restart it.
#killall apache2
#/etc/init.d/apache2 start

I wonder why the other way didn't work?!?
But the file types are still setup incorrectly.

Things seem to have improved slightly when I changed

DefaultType from text/plain to application/octet-stream

PHP files now seem to work properly.
However, most files that I try to download or open in the browser are 0 bytes long, like png files

EDIT:
I also tried to add the line
AddType image/png .png

to the apache2.conf file, but it seems to have no effect.

---------------
EDIT:
Well, now php is working. But installing phpmyadmin did not install mysqld. Images still do not work.
 
Back
Top Bottom