Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting up localhost webserver

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
mmm



Joined: Sat May 28, 2005 7:50 pm
Posts: 7

PostPosted: Sat May 28, 2005 8:19 pm    Post subject: Setting up localhost webserver Reply with quote

I am a virtual newbie to Linux, so please bare with me on this one, as I am trying out Linux Mandriva to hopefully one day dump Window$. Although, I have installed Mandrake before, I've never tried it for serious work...

Anyway, on my Windows setup I have installed Apache, PHP, and MySQL - all of which I use to test my website(s) offline, before I put them online. Everything works fine.

In Linux, Apache auto loads (from what I noticed from previous Mandrake install), and I have also installed PHP and MySQL (all at install time).

So far, so good. The problem is, all the data is on my FAT32 / Windows drives. I do not want to copy over the files to a Linux partition as then in Windows I will not have access to the files.

So, I would like to know if there is a way to have the Linux Apache have access the Windows partition files.

Note 1: All my FAT32 drives auto mount at startup of Linux.

Note 2: Editing Linux line ending files when in Windows is no problem, as I have an editor that will read / write both Windows and Linux format text files, line endings.

I noticed the httpd.conf setup file for Apache is CONSIDERABLY shorter in Linux than it is for the Windows machine, so that's doubly confusing on how to edit the file.

So I guess I would like to know if it's possible for Linux to access / use the Windows partitions for Apache, and how to write what / where in the Linux Apache config file httpd.conf

Thanks
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8439
Location: Warrington, UK

PostPosted: Sat May 28, 2005 9:22 pm    Post subject: RE: Setting up localhost webserver Reply with quote

You need to change the setting for DocumentRoot to point to your Windows directory containing the files. You also need to change the <Directory> setting for the old DocumentRoot directory to the new value.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Guest






PostPosted: Sun May 29, 2005 4:12 pm    Post subject: RE: Setting up localhost webserver Reply with quote

not sure why you would want to do this... but you just point the httpd.conf to the windows mount. By default, apache points to /var/www/html, you can change it to /mnt/windows/my documents/my webs or whatever your mount point is. So basically, just alter the DocumentRoot line in you httpd.conf file,

Good luck.

Regards
Richard
Back to top
mmm



Joined: Sat May 28, 2005 7:50 pm
Posts: 7

PostPosted: Mon May 30, 2005 7:11 pm    Post subject: Reply with quote

I tried amending the httpd.conf file (server stopped), and also the hosts file. but I don't get much joy. The server does work, as when you type to find 127.0.0.1, you get the message that the server is configured here welcome page.

The problem is, I get the same message for all the "virtual hosts" entries I tried, worse, that if I try to find say mydomain/index.html, it says it cannot be found. On my Windows setup, going to the virtualhost location gets you the directory tree of that URL.

However, I'll concentrate on the biggest problem, that DocumentRoot is not pointing to where I want it to, according to the error log for the server. This is what I've put into the httpd.conf file:

DocumentRoot "/mnt/win_c2/Web Page/Internet - working on"

The following error is produced when I try accessing the index.htm file that under the Windows / Apache setup exists.

[Mon May 30 18:22:17 2005] [error] [client 127.0.0.1] File does not exist: /var/www/html/index.html

Why is it pointing to /var/www/html/ instead of my Windows location?
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8439
Location: Warrington, UK

PostPosted: Mon May 30, 2005 7:45 pm    Post subject: Reply with quote

That looks like an invalid setting, so maybe Apache is reverting to the default. It should be something like

DocumentRoot "/mnt/win_c2/Web Page"
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
mmm



Joined: Sat May 28, 2005 7:50 pm
Posts: 7

PostPosted: Tue May 31, 2005 10:58 am    Post subject: Reply with quote

Unfortunately, your suggestion for the shortened DocumentRoot string didn't work.
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8439
Location: Warrington, UK

PostPosted: Tue May 31, 2005 12:54 pm    Post subject: Reply with quote

What does "didn't work" mean?

Did you set up a suitable <Directory> section too?
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
mmm



Joined: Sat May 28, 2005 7:50 pm
Posts: 7

PostPosted: Wed Jun 01, 2005 10:16 pm    Post subject: Reply with quote

I forgot about adding / amending the <Directory> section, so I copied that from my Windows setup (which works).

Apologies for being vague, but in "not work" I mean the same error is still occuring, that 127.0.0.1 is showing itself as "/var/www/html/" etc. in the error log file. It does not seem to recognise the directory that I have told Apache2 to use (should work even if it is a Win directory).

And for others that are curious, I want to get it working on accessing the "Windows" files as for now Windows is very much my main OS, I am "playing" / learning more about Linux until such time that I can dump Win.

Here is a section that is concerned with the "root" of the server:

Code:

DocumentRoot "/mnt/win_c2/Web Page/"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
# This bit commented out by me, following uncommented section
# is taken from the Windows version of this file.
#<Directory />
#    Options FollowSymLinks
#    AllowOverride None
#</Directory>

<Directory />
    Options FollowSymLinks ExecCGI ALL
    AllowOverride All
#    AllowOverride None
    order allow,deny
    allow from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "/usr/local/apache2/htdocs">
<Directory "/mnt/win_c2/Web Page/">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks All +ExecCGI
#    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>
Back to top
View user's profile Send private message
mmm



Joined: Sat May 28, 2005 7:50 pm
Posts: 7

PostPosted: Sun Jun 05, 2005 10:04 am    Post subject: More on http.conf Reply with quote

As a "flash" of boredom, I decided to do a search for the text pattern "www/html" for every file.

I came up with a few hits, but the most of interest was to a httpd.conf file located in:
/usr/share/ADVX/compat

I have heard that in Linux you can create "symbolic links" to files, I guess something similar concept to Windows shortcuts. Could this be a file that is symlinked somehow? And if so, how would I find out? This is the only file that I can think of that is preventing the DocumentRoot I want being read properly, as it is, that file contains:
DocumentRoot /var/www/html
... the exact thing that the error_log file has logged.

I don't want to change / rename / delete anything that could scr*w up the setup.
Back to top
View user's profile Send private message
skecs



Joined: Fri Apr 22, 2005 10:22 am
Posts: 76
Location: Bathurst, NSW Australia

PostPosted: Sun Jun 12, 2005 6:44 am    Post subject: Reply with quote

Does the Apache server user, "www" or "www-run" or similar, have read & execute permissions to the directory mounted on "/mnt/win_c2/Web Page/" ? You can "ls -al /mnt/win_c2/Web Page/" which should display permissions.

Is the Windows directory mounted at boot or are you manually mounting the directory everytime you are checking the files?
_________________
Regards from
Downunder!
.... _
... (0)>
... / /\
.. / / .)
.. V_/_
Linux Powered!
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast