SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
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!
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.
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.
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?
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.
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.
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.
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".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.