Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th November 2009, 04:51 PM
tyndallc Offline
Registered User
 
Join Date: Jul 2009
Posts: 3
linuxfedorafirefox
404 Error with Apache on Fedora 12

I am running Fedora 12 32 bit version. I have httpd running, but in a browser when I go to http://localhost, it gives me the apache page. When I put in http://localhost/html, I get a 404 error. In the httpd.conf file for the ServerName, I have localhost:80.

What can I do to get this working? This is way more difficult to setup in Fedora than it is in any other distro that I have used.

Any help would be greatly appreciated.
Reply With Quote
  #2  
Old 18th November 2009, 05:00 PM
signallock Offline
Registered User
 
Join Date: Jun 2006
Age: 23
Posts: 29
linuxfedorafirefox
I see the DocumentRoot is "/var/www/html", not "/var/www"
perhaps this is the reason?
Reply With Quote
  #3  
Old 18th November 2009, 05:53 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,923
linuxfedorafirefox
Quote:
Originally Posted by tyndallc View Post
I am running Fedora 12 32 bit version. I have httpd running, but in a browser when I go to http://localhost, it gives me the apache page. When I put in http://localhost/html, I get a 404 error. In the httpd.conf file for the ServerName, I have localhost:80.

What can I do to get this working? This is way more difficult to setup in Fedora than it is in any other distro that I have used.

Any help would be greatly appreciated.
Your webpages, unless you've set up homedirs (which I doubt since you don't seem knowledgeable enough to do that based on your post), go to /var/www/html/
and you access them through http://localhost/ not http://localhost/html/
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #4  
Old 24th November 2009, 03:34 PM
tyndallc Offline
Registered User
 
Join Date: Jul 2009
Posts: 3
linuxfedorafirefox
Apache

When it comes to setting up apache on fedora, I am definately not very knowledgeable. I found that Debian was very easy to set it up. What is the easiest way to setup a very basic apache setup? If possible, could you provide steps?
Reply With Quote
  #5  
Old 24th November 2009, 10:33 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
linuxfedorafirefox
Signallock & Pete explained well.

Let's do a different approach.
Code:
[marc@kiriyamablevins ~]$ cd /var/www/html
[marc@kiriyamablevins html]$ ll
total 16
drwxr-xr-x. 2 root root 4096 2009-02-02 19:58 cronscripts
drwxr-xr-x. 2 root root 4096 2008-08-29 03:02 pdf
drwxr-xr-x. 2 root root 4096 2009-09-08 13:46 resume
drwxr-xr-x. 2 root root 4096 2009-04-07 00:04 scripts
[marc@kiriyamablevins html]$
Open your browswer to:
http://kiriyamablevins.dyndns.org/pdf

That is the same location cause my DocumentRoot is set to /var/www/html

Since /var is root ownership. You could 'su -' and copy the files over to /var/www/html.

Edit: Don't worry about your knowledge level of Fedora. You will pick it up in time.

Let us know if you got stuck on something, we are willing to help you.

Last edited by marcrblevins; 26th November 2009 at 05:50 AM. Reason: Signallock
Reply With Quote
  #6  
Old 26th November 2009, 04:56 AM
signallock Offline
Registered User
 
Join Date: Jun 2006
Age: 23
Posts: 29
linuxfedorafirefox
Quote:
Originally Posted by tyndallc View Post
When it comes to setting up apache on fedora, I am definately not very knowledgeable. I found that Debian was very easy to set it up. What is the easiest way to setup a very basic apache setup? If possible, could you provide steps?
I think the difference between Apache on Debian and Apache on Fedora is not the software itself, it's the default configuration. Maybe (I'm not familiar with Debian) on Debian, the default DocumentRoot is "/var/www", and it's "/var/www/html" on Fedora. The only important thing to do is reading Apache configuration file. The location is "/etc/httpd/conf/httpd.conf" on Fedora. There you will see DocumentRoot, Port, VirtualHost and many other configurations.

Well the easiest way, first install Apache:
# yum install httpd
Then start the service:
# /etc/init.d/httpd start
By default, httpd will listen port 80, and serve the default directory "/var/www/html", so you can add your index.html to the directory :-)

Last edited by signallock; 26th November 2009 at 10:05 AM.
Reply With Quote
  #7  
Old 26th November 2009, 05:11 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
linuxfedorafirefox
Correction:
I believe you really have to open port 80 first in system-config-firewall. Iptable off at install time?

Start your terminal:
Code:
su -
system-config-firewall
Open 80 and 443 is planned to use secured http.
Reply With Quote
  #8  
Old 25th December 2009, 08:05 PM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183
linuxfedorafirefox
If you already have your files under /var/www/html and you're still getting a 404 then you've failed to change your /etc/httpd/conf/httpd.conf setting that specifies what type of file you're using for your index file. I know this because if you HAD an index.htm or index.html the default apache config would pick it up. If i'm wrong, then i'm a jackass . So, if you're using php files, then you need to add "index.php" before "index.html" in your httpd.conf.

If you're getting a 403 (forbidden) then you need to go to system > seLinux configuration, then select the boolean tab, and then filter by "apache", then select "allow.......... oh wait, i just went to look, and it appears it is not needed any more (i just upgraded from 10 to 12, sorry). Ok, if you're getting a 403 you still need to do:

chcon -Rv -usystem_u -robject_r -thttpd_sys_content_t /var/www/html

that -Rv might be -Rc now......
Reply With Quote
  #9  
Old 8th January 2010, 06:40 AM
sivare Offline
Registered User
 
Join Date: Dec 2009
Location: Mexico City
Posts: 1
linuxfedorafirefox
I'm new with fedora, this last line solve my problem but I don't get exactly what it does, I've read the --help option but still don't figure out what does "-usystem_u -robject_r -thttpd_sys_content_t /var/www/html", could you explain it to me or tell me where to find more information??
Reply With Quote
  #10  
Old 8th January 2010, 06:43 AM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 33
Posts: 1,183
linuxfedorafirefox
Well, i'm not an SE Linux guru, but i always find a way to work WITH it, instead of turning it off.

That command's first 2 flags are common to a lot of SE contexts, but the last 1 (-t) tells SE Linux that the context is to be set as a web server allowed file / content (hence the httpd_sys part). That way, SE Linux will allow the web server (httpd) to access it.

I'm sure that someone else more experienced with SE Linux will come along and explain what i can't.
Reply With Quote
Reply

Tags
404, apache, error, fedora

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Error 403 Forbidden with an Alias location (using Fedora 7) douglazb Using Fedora 1 14th May 2008 05:45 AM
Apache error 403 Forbidden fedora 7 lanrat Servers & Networking 28 20th June 2007 08:28 AM
Notice: Undefined index error in Fedora when using php and apache palanisamy Programming & Packaging 6 8th May 2006 10:18 PM
apache error tgone Servers & Networking 16 7th May 2006 08:34 AM
FC5 Apache Error mick-porter Using Fedora 11 30th March 2006 08:11 AM


Current GMT-time: 14:17 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat