Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache on Fedora

Status
Not open for further replies.

mattthumper

Programmer
Jul 8, 2010
7
US
Hi,

A 100 years ago (yes, way back in the late 90's) when I was learning Linux and first doing networking (client-server) I built a RedHat server (just a glorified workstation/desktop) and a separate RedHat client workstation, both with older and leftover PCs.

I installed Apache and configured it as the Web server and could connect to it from my client machine.

Well, now in a different time and place, I find myself with another Linux box at home and would like to resurrect my old Web Site (since I still have all the files and scripts).
It's running Fedora (the latest I think, what is that 13?).

What I'd like to do is install Apache and make my Linux box be the Web server. Then, 1st, be able to access my Web Site thru Apache - on that same box. Then, when that works, access the site (probably just thru IP address) from my Windows 7 PC which sits right next to the Fedora box and they both tie into the same NetGear router/hub.

What I DON'T want to do is read thru reams of Apache How-To technical documentation (which I did years ago) - which is why I came here.

Can anyone give me even a partial TO-DO list of things I need to do to accomplish what I hope is a very basic task?

TIA,
Matt
 
1) try browsing to there is a very good chance it is already installed by default :)

if that fails got to ad/remove progamms menu & you should be able to find it, along with php, mysql & other useful extras

the webroot is usually /var/
 
Great. I'll check when I get back from work. Thanks a bunch.
 
IPGuru,

Thanks again.
I had to install Apache - and did successfully.
I swapped it's default index.html with my old one,
and my entire old Web site. Some stuff is working and that is very good!

Now to get into details - which beat the heck out of big problems! 2 things:

1) how do I tell/configure Apache to recognize my host name?
Right now I have to enter as the URL. And
when I start it Apache says:
> /usr/local/apache2/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

(So for that matter is my 'hostname' output what it should be looking for and finding?)

2) The Web site is real simple and most of the links point to very local html files (now sitting directly under /usr/local/apache2/). When I try to go to a local file I get a 403 Forbidden error:

Forbidden

You don't have permission to access /LinuxFiles/directory.html on this server.

Where /LinuxFiles/directory.html is one of those now-local directory/files.

Also, I have a couple if .gifs on the main page that don't show up and my guess is that it's the same thing. How do I get access (via this new Apache Web server) to look at local files?

Again, thanks for the help!
Matt
 
BTW, in httpd.conf I removed this from lines 115-120:

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>


And then added all these (each one is a subdirectory of htdocs):
<Directory "/usr/local/apache2/htdocs">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/examples">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/LinuxFiles">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/LinuxFiles/GUI_Desktop_X">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/LinuxFiles/System_Admin">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/LinuxFiles/Web">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/LinuxFiles/Editors_Shells_Environment">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/matt_ Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/cgi-bin">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/Linux_Site">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/Linux_Site/GUI_Desktop_X">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/Linux_Site/System_Admin">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/Linux_Site/Web">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
<Directory "/usr/local/apache2/htdocs/Linux_Site/Editors_Shells_Environment">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>


-Matt
 
And one last thing:

The hyperlinks to the files (on the Web page, in FireFox) show up like:

Instead of:
/usr/local/apache2/htdocs/System_Admin/System_Admin.html

The Web Site (Web pages) works great when I just open index.html in the browser and I don't go thru Apache.

(IOW, I've used the Web site for years without a real Web server and just opening the index.html file) - so I know that syntactically it's OK.
 
Matt:

1) 403 error: chmod all your directories to 777 and all your files to 666

2) To get rid of the start (and stop) warning and the default to 127.0.0.1 edit the httpd.conf and add a line:
ServerName bubbasbox

where bubbasbox is the output of the hostname command.

-Matt
 
Matt:

Wow, thanks Matt you are a genius! I just wish everyone were as helpful as you are! I just have to remember to go to Dani Web or Rose India to find people as sharp as you.

-Matt
 
I appear to be a little late coming to this thread but I noticed two things in your fixes that you might want to consider.

1 - in your /directory blocks it looks like you have a few distinct document roots. You may not have to specify the permissions for each sub directory as they should inherit from the parent.

2 - Changing permissions to 777 and 666 may work, but it isn't a safe practice. When 'others' is set to writable and executable, web users could potentially run code and delete things. Normally, you want your apache's user account to have access to execute on the directories and others to have only read access. Try using 755 and 644 instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top