Apache2 on Debian Etch not working
Hi all,
I've just tried to install Apache2 on my computer, but it doesn't seem to work. After installing it, I pointed my browser to http://localhost, but I get the "Unable to connect" message. I have also tried running Code:
/etc/init.d/apache2 start Please notice that this is the first time I try to run Apache on my machine, so I'm quite new to this. Thanks a lot for your time :) |
Normally it will work out the package install.
You do need to start apache and /etc/init.d/apache(2) start / restart can be used. you might want to stop it if it is running. ps -ef | grep apache or ps -ef | grep httpd You can see if it is actually running. The other thing is a firewall could be blocking it, but the apache2 start should have mentioned that. you do need to be root when doing /etc/init.d/apache2 start |
Hi,
thanks for your reply. I have used both /etc/init.d/apache2 start and restart, and I have run them as root, but I didn't get any output. However, if I do: Code:
# /etc/init.d/apache2 stop So, I tried to do /etc/init.d/apache2 start again, but again I could see no output and the address http://localost won't work. By the way: Code:
# ps -ef | grep apache2 Code:
# ps -ef | grep httpd Thanks! |
Try to debug the init script:
Code:
sh -x /etc/init.d/apache2 restart |
Ok, this is the output:
Code:
# sh -x /etc/init.d/apache2 restart |
You have asked (/etc/default/apache2, NO_START=1) apache2 to not be started at boot (/etc/init.d).
Invoking it manually is like doing the boot process (init.d doesn't know if you are booting or not) Then you have to start your apache2 by Code:
apache2ctl start |
Thanks for your reply (again)!
What I find odd is that when I shut down the system there is a message that says it's stopping Apache. Anyway, your command is giving me output, but still not working: Code:
# apache2ctl start |
Where to get it?
Mmmhh in the package apache2 How on earth did you install apache2 ?? Quote:
|
I have installed it through apt. How on earth am I missing bits and pieces?
I have uninstalled it and re-installed it: Code:
# apt-get install apache2 |
Code:
touch /etc/apache2/httpd.conf I wonder what happened when you installed it??? Actually what I advice is to reinstall apache2 and its dependencies but you need to PURGE the package. Otherwise in 5mn you will tell me that another file is missing ;) Code:
dpkg -l | grep apache2 Code:
dpkg -l | grep apache2 | awk '{print $2}' | xargs aptitude purge Quote:
It's critical to stop a process before a shutdown. I agree it's a bit messy :) |
AH! Thanks, it's working now :)
I get a message like this: Code:
# apache2ctl start Thanks a bunch for your help! :) EDIT: Ah! I forgot to mention that I still had to creat the httpd.conf empty file. And now I have installed php ( php5 and libapache2-mod-php5) in order to see my website offline, but the pages are not working (when I try to see them with Iceweasel, it offers me to donwload them). And notice that Apache is running and working... EDIT2: Nevermind, now everything is up and running. Thanks again for your help! :) |
Hi,
I am stuck between here: Quote:
Quote:
btw: I just upgraded from Ubuntu 6.10 to 7.04 and that made it stop working. |
Most likely it was configuring apache to serve php pages...
Quote:
|
Thanks for your answer.
The only httpd.conf I could find is located here: /etc/apache2/httpd.conf And it contains only the following: Code:
# This is here for backwards compatability reasons and to support http://localhost/phpmyadmin/changelog.php is displayed as expected, but http://localhost/phpmyadmin/index.php firefox wants to download as an empty page. Any ideas? |
yes, I think you missed the same thing I had missed: in order to see a webpage you have to put it in the folder /var/www/ (notice that you can also put the whole website folder in there). After that your pages will be visible ;)
|
Unfortunately, that's not the solution to my problem, but thanks for the answer.
|
is the php header on the page correct ?
|
I'm not sure what you mean by "php header".
Maybe this one from the phpmyadmin index.php: PHP Code:
PHP Code:
|
You could install this
:twocents: |
Oddly I had a similar problem upgrading. I am currently using php4, when upgrading sarg to etch, apt decided to install the apache2 module for php5. I simply apt'ed the right one and it behaved nicely after that. This was on a Alpha box if that makes a difference.
|
Could it be a problem on ubuntu?
Could it be that you should open a new thread in ubuntu ? :D |
Quote:
|
Quote:
|
Another removal/installation of the phpmyadmin-package did the job. Furthermore I remove the directory /usr/share/phpmyadmin/ by hand in between. Maybe that was the point. Anyway: Thank's for your help.
|
I guess I'm late, but some people may have such problem like I had before.
in order to run apache2 you should use the following command: Code:
apache2 -k start|restart|stop For some reason it s different in apach2 for Debian. They also have changed httpd.conf name to apache2.conf If you have apache2.conf, you should comment the entry for httpd.conf if it exists. |
Quote:
|
Farslayer: I know I'm way late on the thread, but thank you for post #13! I have been browsing the web for 30 minutes looking for exactly this:
Quote:
Thanks again! CJ |
Quote:
Go back to Post #6 and reread that... You have to edit a variable in the file /etc/default/apache2. Code:
{YOU ARE ROOT} Also, I disagree: You should not comment the entry for httpd.conf. I'm no expert, but I gather that the reason for its being there is to make it easier to enact user (err, administrator -- as opposed to Apache developer) modifications to the way Apache runs. The apache2.conf file is big and heavily commented, and there's nothing wrong with editing it when necessary, but when all you need to do is one quick little thing like add PHP support (perhaps temporarily, to test, see if it will work), it's a lot easier to do it in a smaller file (e.g. httpd.conf) where it's much easier to find your modifications and distinguish them from the configurations provided by the package maintainers. I can see your viewpoint, however, and I also agree with it -- sometimes it's easier just to edit one great big huge file, so that you can keep everything together and you know where it all is (e.g., did I make the PHP enablement in apache2.conf, httpd.conf, or in one of my (God knows how many) sites-available/* files?)... However, for me, that's like keeping all of my clothes in one great big drawer in my dresser; No matter how well I fold them (commenting, dividing a file) I still wind up with a bunch of stuff in one location that's hard to go through to get what I want out of it. I see apache2.conf as being intended for overall webserver config, httpd.conf as being for this-system's-administrator's-changes, and the various files in sites-available as being for website-specific alterations. If you want per-directory stuff, keep it in .htaccess. Anywhoo, hope this helps. Cheers! |
Apache2 in Debian 2.6. after upgrade
I just upgraded debian using dist-upgrade. Then Apache is not working. Any idea?
I tried $/etc/init.d/apache start or $apache2ctl start It just say starting. Then, I tried $ps -aux | grep httpd shows nothing. So apache is not running |
All times are GMT -5. The time now is 11:24 PM. |