LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 04-16-2007, 12:03 PM   #1
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Rep: Reputation: 15
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
to see if it was running, but I get no output, so I'm really wondering if there is something I need to configure...

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
 
Old 04-16-2007, 02:09 PM   #2
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
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
 
Old 04-16-2007, 05:48 PM   #3
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
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
Stopping web server (apache2)....
It seems it was running.

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
root      6533  6458  0 23:46 pts/1    00:00:00 grep apache2
Code:
# ps -ef | grep httpd
root      6535  6458  0 23:46 pts/1    00:00:00 grep httpd
I am not sure about what those 00:00:00 mean, not very encouraging...

Thanks!
 
Old 04-17-2007, 06:02 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Try to debug the init script:
Code:
sh -x /etc/init.d/apache2 restart
 
Old 04-17-2007, 07:52 AM   #5
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
Ok, this is the output:
Code:
# sh -x /etc/init.d/apache2 restart
+ ENV='env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin'
+ NO_START=0
+ set -e
+ '[' -x /usr/sbin/apache2 ']'
+ HAVE_APACHE2=1
+ . /lib/lsb/init-functions
++ FANCYTTY=
++ '[' -e /etc/lsb-base-logging.sh ']'
++ true
+ test -f /etc/default/rcS
+ . /etc/default/rcS
++ TMPTIME=0
++ SULOGIN=no
++ DELAYLOGIN=no
++ UTC=yes
++ VERBOSE=no
++ FSCKFIX=no
++ RAMRUN=no
++ RAMLOCK=no
+ test -f /etc/default/apache2
+ . /etc/default/apache2
++ NO_START=1
+ '[' 1 '!=' 0 -a restart '!=' stop ']'
+ '[' no '!=' no ']'
+ exit 0
 
Old 04-17-2007, 10:33 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
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
 
Old 04-17-2007, 03:07 PM   #7
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
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
apache2: Syntax error on line 189 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
So I guess I need that config file... where to get it?
 
Old 04-17-2007, 06:16 PM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Where to get it?

Mmmhh in the package apache2

How on earth did you install apache2 ??

Quote:
What I find odd is that when I shut down the system there is a message that says it's stopping Apache.
I don't see anything strange?!

Last edited by nx5000; 04-17-2007 at 06:18 PM.
 
Old 04-18-2007, 07:03 AM   #9
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
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
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  apache2-mpm-worker
The following NEW packages will be installed
  apache2 apache2-mpm-worker
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/459kB of archives.
After unpacking 766kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Selecting previously deselected package apache2-mpm-worker.
(Reading database ... 76551 files and directories currently installed.)
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.3-4_i386.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.3-4_all.deb) ...
Setting up apache2-mpm-worker (2.2.3-4) ...

Setting up apache2 (2.2.3-4) ...
theraft:/home/mmanu# apache2ctl start
apache2: Syntax error on line 189 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
what I find odd is that while apache is not starting at boot, there is a message that it's stopping when I shut down the computer...
 
Old 04-18-2007, 07:21 AM   #10
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Code:
touch /etc/apache2/httpd.conf
This will create an empty file. Mine is empty and its an unmodified version.

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
if you are not scared of removing them all, use this:
Code:
dpkg -l | grep apache2 | awk '{print $2}' | xargs aptitude purge
Quote:
what I find odd is that while apache is not starting at boot, there is a message that it's stopping when I shut down the computer...
The variable is called NO_START, not NO_START_STOP.
It's critical to stop a process before a shutdown.

I agree it's a bit messy
 
Old 04-18-2007, 08:38 AM   #11
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
AH! Thanks, it's working now
I get a message like this:
Code:
# apache2ctl start
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
but I guess it's fine.

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!

Last edited by finferflu; 04-19-2007 at 05:35 AM.
 
Old 04-25-2007, 09:57 AM   #12
nikopp
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Rep: Reputation: 0
Hi,

I am stuck between here:
Quote:
Originally Posted by finferflu
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...
and there:
Quote:
Originally Posted by finferflu
EDIT2: Nevermind, now everything is up and running. Thanks again for your help!
Could you please tell me how you solved the problem?

btw: I just upgraded from Ubuntu 6.10 to 7.04 and that made it stop working.
 
Old 04-25-2007, 10:37 AM   #13
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Most likely it was configuring apache to serve php pages...

Quote:
Now edit httpd.conf using Kwrite or a similar program.

Search inside the file for "LoadModule rewrite_module lib"(hit ctrl + f to search).

Underneath this line type: LoadModule php5_module /usr/lib/apache2/libphp5.so

The directories above just happens to be were my "libphp5.so" file happens to be for me. Type in console: locate libphp5.so

That will tell you were your libphp5.so file is.

Now search the file (ctrl +f) for "AddType application/x-gzip"
Underneath this line add the following two lines:

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps


Save httpd.conf

Now go back into console and type: apachectl start

PHP and Apache should now be working.
http://www.linuxquestions.org/linux/...slackware_10_2
 
Old 04-25-2007, 11:00 AM   #14
nikopp
LQ Newbie
 
Registered: Apr 2007
Posts: 7

Rep: Reputation: 0
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
#  installing 3rd party modules directly via apxs2, rather than
#  through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so
Furthermore, I am totally confused, because

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?
 
Old 04-26-2007, 05:37 AM   #15
finferflu
LQ Newbie
 
Registered: Jun 2006
Location: Manchester, UK
Distribution: Debian Etch / Ubuntu Feisty Fawn
Posts: 26

Original Poster
Rep: Reputation: 15
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
 
  


Reply

Tags
apache2, debian, etch


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems getting intel bg2200 working on debian etch precision Linux - Wireless Networking 2 04-06-2007 05:08 PM
Debian Etch, ATI, Direct Rendering, WORKING juvestar15 Debian 1 03-29-2007 08:57 AM
Can't get microphone working in Debian Etch (testing) Winter Knight Linux - General 1 03-01-2007 06:14 AM
Help requested getting two Dell LCD monitors working with Debian Etch running KDE Phoenix_Zero Linux - Software 12 02-09-2007 11:24 PM
debian, apache2, ipcop and vhosts not working TheSpork Linux - Networking 1 06-04-2005 05:01 PM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration