LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-02-2007, 11:23 PM   #1
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Rep: Reputation: 16
Newbie LAMP Questions


Curious about LAMP, I followed the instruction at http://www.howtoforge.com/ubuntu_debian_lamp_server and noticed that apache failed to start.

http://127.0.0.1/ in IceWeseal returns
Quote:
Unable to connect
Iceweasel can't establish a connection to the server at 127.0.0.1.
Googled and somewhere says add ServerName localhostinto /etc/apache2/apche2.conf. Issuing the command /etc/init.d/apache2 restart , returns
Quote:
Restarting web server: apache2httpd (no pid file) not running
failed!
Apache still fails :-(

Any advise and/or links is appreciate.


THANKS
 
Old 11-03-2007, 12:37 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Did you try to restart apache as root? Have you tried just rebooting the server machine?
 
Old 11-03-2007, 07:19 PM   #3
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
Did you try to restart apache as root? Have you tried just rebooting the server machine?
Yup, tried it as root.
 
Old 11-03-2007, 10:52 PM   #4
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Try this command: /apache2/bin/apachectl start (adjust the path according to where your apachectl file is located). For further options type: man httpd.
 
Old 11-03-2007, 11:56 PM   #5
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
Try this command: /apache2/bin/apachectl start (adjust the path according to where your apachectl file is located). For further options type: man httpd.
Seems odd, /apache2/bin/apachectl returns
Quote:
bash: /apache2/bin/apachectl: No such file or directory
 
Old 11-04-2007, 12:26 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Check if something is wrong with your config.. .
/etc/init.d/apache2 configtest
/etc/init.d/apache2 stop
/etc/init.d/apache2 start

you are issuing a restart which is telling you it can't restart apache2 because it's not running to begin with..
try the more basic stop and start commands rather than the restart..

and you can always look in the error log /var/log/apache2/error.log


The Debian apache2 layout is fully documented in /etc/apache2/README
Code:
ServerRoot              ::      /etc/apache2
DocumentRoot            ::      /var/www
Apache Config Files     ::      /etc/apache2/apache2.conf
                        ::      /etc/apache2/ports.conf
Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations        ::      /etc/apache2/mods-available, /etc/apache2/mods-enabled
ErrorLog                ::      /var/log/apache2/error.log
AccessLog               ::      /var/log/apache2/access.log
cgi-bin                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|stop|graceful|configtest)
so you are looking in the wrong location for apachectl/apache2ctl..

Last edited by farslayer; 11-04-2007 at 12:28 AM.
 
Old 11-04-2007, 01:31 AM   #7
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 16
apache2 still not working

Quote:
Originally Posted by farslayer View Post
Check if something is wrong with your config.. .
..
farslayer, thanks for the pointer. Just tried the following but still unable to get apache2 working



/etc/init.d/apache2 configtest
Quote:
Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean}
/etc/init.d/apache2 stop
Quote:
Stopping web server: apache2httpd (no pid file) not running
.
/etc/init.d/apache2 start
Quote:
Starting web server: apache2 failed!
cat/var/log/apache2/error.log
Quote:
error] (2)No such file or directory: could not open mime types config file /etc/apache2/mime.types.
Configuration Failed
:-(
 
Old 11-04-2007, 04:32 AM   #8
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by lazylogic View Post
cat/var/log/apache2/error.log
It should read cat /var/log/apache2/error.log (note the space between the cat and forward slash) if it still comes back with an error do: cat /var/log/httpd/error.log
 
Old 11-04-2007, 07:26 AM   #9
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 16
Finally got it !

I've finally solved it!! Will note it down for future users :-)

cat /var/log/apache2/error.log returns
Quote:
[error] (2)No such file or directory: could not open mime types config file /etc/apache2/mime.types.
Configuration Failed
Looking inside /etc/apache2/ and noticed that the file mime.types is missing.

However, there is a file called mime.types in /etc/

So I did a symlink
Quote:
ln -s /etc/mime.types /etc/apache2/mime.types
and /etc/init.d/apache2 start works!

############

Understand that the default web file directory is in /var/www/apache2-default/

1. Remember reading an article many months ago stating that the web directory can also be situated at /home/user/some_folder.


2. As I am installing apache out of curiosity, I really only wants apache to serve webpages locally (localhost) and not to any other computers.


Unfortunately couldn't relocate the article anymore. Anyone knows how this can be done?



THANKS!

Last edited by lazylogic; 11-04-2007 at 07:48 AM.
 
Old 11-04-2007, 12:18 PM   #10
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
by a firewall i'd propose
 
Old 11-04-2007, 05:45 PM   #11
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
configure apache to only listen on the loopback address..

should be a documented setting in apache2.conf.
 
Old 11-04-2007, 11:29 PM   #12
parf
Member
 
Registered: Nov 2007
Distribution: debian
Posts: 39

Rep: Reputation: 15
i wonder if you're referring to

allow from 127.0.0.1 and commenting out the line allow from all,
 
Old 11-05-2007, 02:48 AM   #13
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
i think thats what he thought of but dont take 127.0.0.1 but

Order deny,allow
Deny from all
Allow from 192.168.xxx

You could use mod_rewrite, too.

Last edited by j-ray; 11-05-2007 at 02:57 AM.
 
Old 11-05-2007, 06:05 AM   #14
lazylogic
Member
 
Registered: Aug 2006
Posts: 151

Original Poster
Rep: Reputation: 16
Thanks

Thanks all for the info. I'll try them out :-)
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: Newbie! Best Flavor for LAMP Server monkeynote Linux - Server 15 08-09-2007 07:24 PM
LXer: LAMP vs. LAMP Rematch LXer Syndicated Linux News 0 11-08-2006 03:03 AM
LXer: LAMP vs. LAMP LXer Syndicated Linux News 0 08-22-2006 11:33 PM
General msAccess vs LAMP questions! Randall Slack Linux - Software 17 09-02-2005 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration