LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-10-2007, 09:56 AM   #1
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Rep: Reputation: 15
Apache Outta the Box - Am I on Glue?


I am a complete noob to Apache, so I apologize for what may be very obvious to some of you. That's why I'm here to ask for help

Slackware 11.0 with Apache defaults. I can't access webpages remotely but I can right from the server itself.

I'm guessing I need to modify httpd.conf and add the particular Directory I want to allow all to access to? Is the default permissions to basically deny all access to all folders under htdocs?

I could use .htaccess, but people seem to recommend against those files..?

For example, just for testing I want to access the "manual". I can using localhost, but not from another workstation. I get server not found in Firefox.

I think i'm on the right track, just looking for a couple tips and/or confirmation.

Much appreciated.

Thanks!
 
Old 08-10-2007, 10:18 AM   #2
gibson79
Member
 
Registered: Feb 2007
Distribution: Slackware
Posts: 40

Rep: Reputation: 15
Do you have a router or firewall between the machines that would block access to port 80?

Not sure about trying to access the manual from a remote machine, but have you tried just accessing the default index.html page in htdocs from the remote machine?
 
Old 08-10-2007, 10:33 AM   #3
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gibson79
Do you have a router or firewall between the machines that would block access to port 80?

Not sure about trying to access the manual from a remote machine, but have you tried just accessing the default index.html page in htdocs from the remote machine?

No router/firewall. I can telnet to port 80 fine. I have tried accessing the default page as well.
 
Old 08-10-2007, 12:30 PM   #4
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
I'm no expert, but

try running (as root on the server)

netstat -apNlt

you should see something like

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN 3638/httpd

if you do, and there is definitely no firewall messing things up,
then double check that your are entering the correct address on the remote browser.
I think if the problem was access permission you would get permission denied, whereas if you are getting 'server not found', then its more likely you are trying to connect to the wrong address.

tobyl
 
Old 08-10-2007, 12:39 PM   #5
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tobyl
I'm no expert, but

try running (as root on the server)

netstat -apNlt

you should see something like

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN 3638/httpd

if you do, and there is definitely no firewall messing things up,
then double check that your are entering the correct address on the remote browser.
I think if the problem was access permission you would get permission denied, whereas if you are getting 'server not found', then its more likely you are trying to connect to the wrong address.

tobyl
There is positively no firewall. I am on my home LAN through a simple switch (hub). I can create the htdocs/phpinfo.php file and remotely access and view it just fine. But I can't remotely view anything in a subdirectory of htdocs/. It is finding the and it is allowing port 80, it's just not letting me see in other dirs. That's why I'm thinking it's the configuration of httpd.conf and being very restrictive by default so that when you install it, it doesn't just open up everything to everyone automatically. I like that philosophy. In the case of Apache, it's just not as obvious what I need to do to make this work. Thanks for helping!
 
Old 08-10-2007, 02:26 PM   #6
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by terosaur
There is positively no firewall. I am on my home LAN through a simple switch (hub). I can create the htdocs/phpinfo.php file and remotely access and view it just fine. But I can't remotely view anything in a subdirectory of htdocs/. It is finding the and it is allowing port 80, it's just not letting me see in other dirs. That's why I'm thinking it's the configuration of httpd.conf and being very restrictive by default so that when you install it, it doesn't just open up everything to everyone automatically. I like that philosophy. In the case of Apache, it's just not as obvious what I need to do to make this work. Thanks for helping!
Who owns the subdirectories? They must be owned by the web server user. Check the ownership of htdocs, and make sure the subdirectories and files have the same owner.

Brian
 
Old 08-10-2007, 02:34 PM   #7
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by BCarey
Who owns the subdirectories? They must be owned by the web server user. Check the ownership of htdocs, and make sure the subdirectories and files have the same owner.

Brian
root owns the htdocs, subdirectories and the phpinfo.php file I tested against. Completely vanilla install at this point.
 
Old 08-10-2007, 02:44 PM   #8
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
And who is the user that runs apache?
Still if it would have been a permission error, the error message wouldn't be server not found but access denied.
Are you 10000% sure you input the right address? http://IP/subDir/document.html?
 
Old 08-10-2007, 02:48 PM   #9
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by terosaur
root owns the htdocs, subdirectories and the phpinfo.php file I tested against. Completely vanilla install at this point.
...and are they all world-readable?

The webserver runs with a user/group defined in httpd.conf. It is usually something like "apache" or "nobody" or "httpd". "grep User httpd.conf" will show you the current setting. Personally, I usually set all my web files to be owned by the web server user and remove global permissions.

You should not have to explicitly give permission in httpd.conf for subdirectories as long as they are readable by the web server user.

Brian
 
Old 08-10-2007, 03:04 PM   #10
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
in my default httpd.conf user and group are set to daemon
Fresh install never modified.
So I would bet my hand he has it the same.
 
Old 08-10-2007, 03:17 PM   #11
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tux-Slack
And who is the user that runs apache?
Still if it would have been a permission error, the error message wouldn't be server not found but access denied.
Are you 10000% sure you input the right address? http://IP/subDir/document.html?
There is 1 instance of apache running as root and the others run as nobody. I am sure of the folder path. I have even tried the /manual subdir...although I can't say for certain I used index.html, but the DirectoryIndex setting in apache is index.html so that don't matter.

Thanks!
 
Old 08-10-2007, 03:23 PM   #12
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by Tux-Slack
in my default httpd.conf user and group are set to daemon
Fresh install never modified.
So I would bet my hand he has it the same.
That's odd...I have not changed these either, and Apache 1.x in Slack 11 defaulted to "nobody" and Apache 2 in Slack 12 defaults to "apache".

Brian
 
Old 08-10-2007, 03:24 PM   #13
Tux-Slack
Member
 
Registered: Nov 2006
Location: Slovenia
Distribution: Slackware 13.37
Posts: 511

Rep: Reputation: 37
Yes you don't need to input index.html into the URL.
One instance for root is because you were logged in as root when you ran /etc/rc.d/rc.httpd start and the other are nobody because it is set so in httpd.conf
That is normal. But I still wouldn't belive that this is the problem with file permissions because you would not get a server not found error in the browser.
Although just to be sure, make clear that they are all publicly readable.
Go to the dir that contains htdocs and run
chmod -R 664 htdocs/
Witch will make all files and directories as read-write for file owner, same for file owner group and make it read-only for others, witch is then publicly readable.
And then you still need to fix that dirs are marked as executable witch you do with:
chmod +x htdocs
and do the same for all directoryes in htdocs a.s.o.
 
Old 08-10-2007, 03:25 PM   #14
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by terosaur
There is 1 instance of apache running as root and the others run as nobody. I am sure of the folder path. I have even tried the /manual subdir...although I can't say for certain I used index.html, but the DirectoryIndex setting in apache is index.html so that don't matter.

Thanks!
And have you checked the permissions? Also, try with a static html file like index.html instead of a php file to eliminate that variable. It also seems strange to me that you have an httpd process running as root. They should all be "nobody".

Brian
 
Old 08-10-2007, 03:54 PM   #15
terosaur
Member
 
Registered: Mar 2003
Distribution: Slackware 12.0
Posts: 79

Original Poster
Rep: Reputation: 15
Thanks guys, I will double-check all those things this evening.

So to confirm, I shouldn't need to specify any new sub-dirs of htdocs in the httpd.conf file?

Thanks!
 
  


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
Wierd Al - Straight outta Lynnwood wayloud Linux - General 1 09-27-2006 04:25 PM
Fresh outta the can noob needs help w/ dependencies, Yum penguinista66 Linux - Newbie 1 07-28-2005 10:55 AM
Ive ran outta things to do.. at least I think so... bripage Linux - General 4 09-11-2002 05:55 PM
running outta ideas digital bots Linux - Newbie 3 03-02-2002 01:05 PM
Bash? Get me outta here! Timato Linux - Newbie 7 09-05-2001 01:40 AM

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

All times are GMT -5. The time now is 05:55 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