LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-25-2014, 11:47 AM   #1
fbooth
LQ Newbie
 
Registered: Dec 2014
Location: Texas
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
Internal website - Raspberry Pi


When I address (with the browser) the IP of the Raspberry Pi, where does it go to obtain the response... does it always go to /var/www?

I find during experimentation: one time it went to index.php and another time it went to index.html. How do I maintain the exact location?

Last edited by fbooth; 12-25-2014 at 11:49 AM.
 
Old 12-25-2014, 11:57 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
If the httpd webserver is configured to serve webpages from /var/www then it would look in to that. Usually /etc/httpd.conf holds the option to look where and also default page to serve. i.e. either index.html or index.php. You can instead give it full filename like http://address/index.php
 
1 members found this post helpful.
Old 12-25-2014, 12:15 PM   #3
fbooth
LQ Newbie
 
Registered: Dec 2014
Location: Texas
Distribution: Ubuntu
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by veerain View Post
If the httpd webserver is configured to serve webpages from /var/www then it would look in to that. Usually /etc/httpd.conf holds the option to look where and also default page to serve. i.e. either index.html or index.php. You can instead give it full filename like http://address/index.php
Thank you! That cleared up my understanding of how the webserver is configured.
 
Old 12-25-2014, 12:16 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
my limited experience with apache is that its chrooted directory tree is in /var/www/html and that the default page is index.html and if that doesn't exist it looks for index.php.

edit: jinx veerain.

Last edited by schneidz; 12-25-2014 at 12:28 PM.
 
Old 12-25-2014, 01:10 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
The default root directory can be checked in httpd.conf

On my Slackware server it's:
Code:
...
<Directory "/srv/httpd/htdocs">
...
To enable .php pages, you need to uncomment the following line in httpd.conf:
Code:
Include /etc/httpd/mod_php.conf
Also, the code below specifies the order of reading files (first the server will check for .php files. If they are not present, .html files will be looked for.

Code:
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>
You can have your root directory elsewhere - for example in your home directory. To do this you need to uncomment the line below (and edit the httpd-userdir.conf file accordingly):
Code:
# Include /etc/httpd/extra/httpd-userdir.conf
Bear in mind that the last option might not be enabled by default. For example, on Slackware in the stock apache package the 'userdir' option is not enabled.

Last edited by sycamorex; 12-25-2014 at 01:11 PM.
 
Old 12-25-2014, 04:58 PM   #6
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636Reputation: 636
and don't forget to restart Apache to reload the configration after you have made changes.

jlinkels
 
Old 12-26-2014, 01:46 AM   #7
Miati
Member
 
Registered: Dec 2014
Distribution: Linux Mint 17.*
Posts: 326

Rep: Reputation: 106Reputation: 106
Code:
        <Directory /var/www/example>
        DirectoryIndex gallery.html index.html directory_index.html
        Options Indexes FollowSymLinks
        AllowOverride None

        Allow from all
        Satisfy all

        </Directory>
This is a pretty simple version of a website.
The "index" files are specified as DirectoryIndex, with the first having preference (if your local ip starts with 192.168.1.*
Various options
AllowOverride (involves .htaccess files, I don't use them so I disable them)

Allow from all, this means anyone can access at any time. You can make this more specialized eg. Allow from 192.168.1.1/24 to permit all lan but no external addresses
Satisfy all, make sure all requirements are satisfied before permitting access
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Bind9 and An Internal Website BorgKiller *BSD 4 05-29-2006 12:10 AM
internal website? ryedunn Linux - Newbie 1 12-31-2004 04:54 PM
Squid messing up Internal Website Osiris123d Linux - Networking 3 08-20-2004 04:20 PM
Permit access to only one website from a station in the internal network rocordial Linux - Security 20 06-06-2004 07:58 PM
Netgear router blocking website when using internal network esteeven Linux - Networking 8 09-30-2003 08:48 AM


All times are GMT -5. The time now is 12:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration