PDA

View Full Version : apche problem



naved
12th June 2011, 03:03 PM
i had installed and cheked lamp stack last night bt today when i type http://localhost the fodora test page for apache didt come up ..it is just blank ...i had also configured apache to load after every boot ..still i m facing this problem what to do now ?
plz help ?

Jake Jast
12th June 2011, 03:08 PM
The httpd service is running?

satanselbow
12th June 2011, 03:19 PM
In a terminal type@



chkconfig --list


Scan through the list and check that httpd (and mysqld) are configured to autostart for runlevel 5

If runlevel 5 is not set to "on" type:



chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on


which will set httpd + mysqld to autostart for runlevels 2, 3 and 5 - which covers most uses ;)

naved
12th June 2011, 04:26 PM
In a terminal type@



chkconfig --list


Scan through the list and check that httpd (and mysqld) are configured to autostart for runlevel 5

If runlevel 5 is not set to "on" type:



chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on


which will set httpd + mysqld to autostart for runlevels 2, 3 and 5 - which covers most uses ;)
did every thing and , it was "on" at run level 5 still teh page is blank at http://localhost

---------- Post added at 03:26 PM ---------- Previous post was at 02:54 PM ----------


The httpd service is running?

yes it is running

Jake Jast
12th June 2011, 04:41 PM
Are you sure that you haven't put any "index.html" or sort of these file in the root directory of your server?
If not, try to make a file called "index.html" in the root of the server. Maybe you have removed the fedora test page from your pc or you have changed something of wrong in the httpd.conf file.

naved
12th June 2011, 07:21 PM
Are you sure that you haven't put any "index.html" or sort of these file in the root directory of your server?
If not, try to make a file called "index.html" in the root of the server. Maybe you have removed the fedora test page from your pc or you have changed something of wrong in the httpd.conf file.

bt whenever i try to edit or modify any thing under root directory of apache it shows me an error sayin u dont have enough permission how to fix that ? i m using gedit editor

satanselbow
12th June 2011, 07:25 PM
bt whenever i try to edit or modify any thing under root directory of apache it shows me an error sayin u dont have enough permission how to fix that ? i m using gedit editor

I am really getting some deja vu here...

To edit files in /var/www/html



sudo gedit /var/www/html/name-of-file.php


or... as previously suggested move your document root to an area under your home folder where you can create / edit / delete with regular user permissions ;)

naved
12th June 2011, 07:36 PM
I am really getting some deja vu here...

To edit files in /var/www/html



sudo gedit /var/www/html/name-of-file.php


or... as previously suggested move your document root to an area under your home folder where you can create / edit / delete with regular user permissions ;)

bt what should i put under index.html file

JohnVV
12th June 2011, 07:56 PM
did you read the Apache instructions ?
on the Apache web site ?
http://httpd.apache.org/docs/2.2/

you also DO KNOW that for securityreasions the www folders are OWNED by the apache user ,AND not by the normal user
you NEED TO BE ROOT to edit them
basic linux 101

Also this is a VERY good example of why i have people install
-- FROM SOURCE --
Apache
MySQL
PHP
PhpMyAdmin

so you LEARN HOW to set up a server and how to use it
think of it this way .

the web site is 100% of the final grade for a Univ. class
it is all or nothing 100% of the grade
and you MUST MUST get a 4.0 on it
-- no if' and's or but's -- a 4.0 !!!

Jake Jast
13th June 2011, 11:03 AM
The your server root is "/var/www/html/". Isn't it?

katykat
14th June 2011, 08:39 PM
Its best to run webservers as root.

May also need to turn off Selinux or at least configure it as errors come up.

Also: Check the docs to ensure that you have the starting directory set right.

Might also want to consider the LAMPP package which sets up its own independent LAMP stack in /OPT and keeps its packages apart from the system utilities, and is turned on and off at the desktop. It is designed for LOCAL testing and *not* a production environment though.

I myself have had a devil of a time with the CGI directory, since Apache seems to set its OWN permission requirements (on a standard, and not a LAMPP system).

JohnVV
14th June 2011, 09:07 PM
Its best to run webservers as root.

NO a very BIG NO !!!!!!!!!!!!!!!
Apache uses the normal user "apache" account
It is NEVER a good idea to run 24/7 as root .


May also need to turn off Selinux or at least configure it as errors come up.

NO , that is a very bad idea .
if you MUST for testing and setting up
set SELinux to permissive and FIX EVERY AND ALL warnings !!!



since Apache seems to set its OWN permission requirements
set for security reasons. That is why you make a normal user called "apache"

katykat
14th June 2011, 10:04 PM
Certainly good advice in a production environment , but can *someone* please explain how it gives any more security to a webserver set to ONLY run locally?
(One good reason to use the LAMPP package as it defaults to being ONLY a local server)


Since permissions problems can be very cryptic indeed, I usually test things as ROOT *before* testing it as a user. And then take it from there.

An honest question.
Just want to now WHAT any dangers are.

Most Unix hacks are those that are able to jump to root from stack overflows and the like, so being a 'normal' user would not help.

I've never 'accidentally' damaged any files as root. I use a file manager and not the command line for maintenance.

Web servers are of course different, and working ones need full and total protection from every freaking thing.
But is that true running locally?

Right now to avoid all the permissions hassles I need to run my Oscommerce test site in Win on a FAT partition. It boils my blood to see a 'permission denied' on my own system - especially when I know exactly what I am tryign to do, and does not give me the option to override.

Dont get me wrong.
I actually like Selinux, and user permissions - especially on Web apps like browsers.
And have no problem in dealing with them as a *final* step in development.

But I see it as a major design bug when certain apps will fail due to permissions and not at least come up with an su option. Or even say *why* they failed.

JohnVV
15th June 2011, 12:16 AM
this is fedora here
fedora is VERY well known not to work well if logged in as root in gnome,kde,xfce,...

running a headless fedora install ? - why -- the root gui issue is not there
apache on fedora uses the apache user
and the apache user is set for SELinux context

do what you want
but most do not want other servers "zombiefide" for OUR AND MINE security
we give a "BLEEP" about you it is the net we care about .




But I see it as a major design bug when certain apps will fail due to permissions
this is why testing is done in "permissive" mode
you get ALL the warnings but se will not block it
fix the warnings and set to "enforcing"

katykat
15th June 2011, 07:00 PM
What I am trying to wrap my head around are real, and not theoretical issues.

If I have number of ports blocked at the router, hosts.deny to all:all, and running something like LAMPP which defaults to *LOCAL* mode - why would I need Selinux at all to meddle with my time until the project is finished and I am ready to tackle the permissions issues head on.

This is why I am designing my website on a Win machine. I want to get the addons and utilities and pages working right without having to worry about what the machine thinks about where they should be or who they should belong to - until I get to that stage.

Its the way I do things: Focus on getting the application working, making sure it is set up and working on the machine. And *then* the local network if necessary - On my Linux machine I do not even permit local network access (though tinkering with the idea on mandriva).

The website is of course different, and why I am taking it in stages. Local. Local Network. Webserver.

Is there any way a local Apache setup can affect the net I am not aware about?