Jump to content

Recommended Posts

I'm working on apache on my iTouch, and I'm trying to change the DocumentRoot to /var/root/Media/Webserver/Documents

 

I changed

 

DocumentRoot "/Library/WebServer/Documents"

 

And

 

<Directory "/Library/WebServer/Documents">

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>

 

 

To

 

DocumentRoot "/var/root/Media/Webserver/Documents"

 

And

 

<Directory "/var/root/Media/Webserver/Documents">

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>

 

 

BUT, I get a 403 forbidden to access / on this server, when I try to access it. Why? I used to have it working....

 

 

I aliased /s/ to where I'm trying to get to, so would it be a permissions problem? And FYI, /var/root/ is a different partition then /Library/WebServer/Documents, and the httpd executable.

 

    Alias /s/ "/var/root/Media/Webserver/Documents/"

    <Directory "/var/root/Media/Webserver/Documents">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

 

 

Entire httpd.conf file- http://pastebin.ca/874011

 

 

Link to comment
https://forums.phpfreaks.com/topic/87984-apache-on-ipod-question/
Share on other sites

I see no one has answered yet so I will have a bash although I'm by no means a Linux expert

 

Yes, I'd check directory permissions on the newly configured folder. If you search the postings here you should find the best advised chmod settings. Check the dir permissions on the old folder and perhaps replicate ?

 

Might be worth double-checking which user you have configured to run the Apache process, root or a user account specifically created for the job (recommended)

 

You should also find Unix/Linux specific information the official Apache docs http://httpd.apache.org/docs/

I checked the permissions, /var and /root had no access for Others, I changed it to Read & Write, but the error still came up.

 

Apache's user and group is currently set to Nobody. I have no way of knowing, or creating another user. (To my knowledge).

 

I can't run it as root, because...

 

# apachectl start
Error:  Apache has not been designed to serve pages while
        running as root.  There are known race conditions that
        will allow any local user to read any file on the system.
        If you still desire to serve pages as root then
        add -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line in your
        src/Configuration file and rebuild the server.  It is
        strongly suggested that you instead modify the User
        directive in your httpd.conf file to list a non-root
        user.
/usr/sbin/apachectl start: httpd could not be started

Sorry for double post, but I didn't see an edit button-

 

My /etc/passwd file-

 

nobody:*:-2:-2:Unprivileged User:/:/usr/bin/false
root:*:0:0:System Administrator:/var/root:/bin/sh
mobile:*:501:501:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1:System Services:/var/root:/usr/bin/false
unknown:*:99:99:Unknown User:/var/empty:/usr/bin/false

 

So... Should I add a user to this or something?

Hmmm... although not a Linux expert it looks like you don't have a suitable Apache user so you may need to create one with appropriate rights. As you say, root isn't recommended and although I've never tried it it looks like Apache have correctly banned it as a user.

 

In Windows it is also adviseable to create a specialised user account with appropriate privs. to run the Apache service

 

The best plan I'd say, is to read through some of the applicable tutorials

http://httpd.apache.org/docs/2.0/misc/tutorials.html

This one looks suitable (poss see pages 2+) http://www.onlamp.com/pub/a/apache/2000/02/24/installing_apache.html#apachect1?page=3

 

Try Ralf Engelshall's free online Apache Manual (PDF)

http://www.apacheref.com/download.html

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.