Forum Moderators: phranque
i am tryng to set up a local development environment, and i seem to be getting away from my goal with every step. Reason: i dont understand what i am doing.
I have a Mac with OSX10.5.6 running on it
I m trying o get my localhost working (i want to see the apache page if i type 'localhos' or '127.0.0.1' in my browser. After that, i want to have my testwebsite visible on localhost by typing localhost/~me. Al=nd if that is ok, i would like to see my rewrites working (.htaccess).
I have been trying to follow tutorials, but in the end i have nothing working anymore. I guess it's bcs of the DocumentRoot in file 1 and file 2 (see below). Possibly the virtual Hostdirecive is wrong too.
Can you please help me?
I have 3 files.
1st is /private/etc/apache2/http.conf
2nd is /private/etc/httpd/httpd.conf
3rd is /private/etc/httpd/user/me.conf
I would like to have various folders in my 'Sites' folder, each containing one of the websites i am working on. Websites use php and htaccess to make clean urls.
my 'local website' is in Sites/testsite
My first file (/private/etc/apache2/http.conf) contains these folders by default for DocumentRoot:
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options FollowSymLinks
AllowOverride None
# Order deny,allow
# Deny from all
</Directory><Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
My second file (/private/etc/httpd/httpd.conf) is like this:
DocumentRoot "/Library/WebServer/Documents" and <Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
My third file is the easiest, it contains this:
<Directory "/Users/me/Sites/">
Options Indexes Multiviews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory> So why is typing http ://localhost in my browser address bar giving me a 404 not found error? "The requested URL / was not found on this server."
Thanks a lot for helping me out
My first file (/private/etc/apache2/http.conf) contains these folders by default for DocumentRoot:
Should i change hem?
To which folder does your DocumentRoot point to /Sites/testsite as a physical system path?
I now have found out that localhost does not return a page (it returns a 404), but localhost/~me/testsite doen return the relevant page. The page is located in /Sites/~me/testsite
I do not understand your last remark: there is no DocumentRoot entry for Sites/testsite in any of the files i mentioned.
A:
My apache2 httpd.conf has
# User home directories
Include /private/etc/apache2/extra/httpd-userdir.conf
My httpd/httpd.conf says:
#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
UserDir Sites
</IfModule>
Q: There's no DocumentRoot directive in any configuration file?
A: yes, as i stated above, there is DocumentRoot "/Library/WebServer/Documents". However, there is no reference to "Sites/testsite", unless you mean in me.conf "<Directory "/Users/me/Sites/"> "
Q: error_log
A: When asking for [localhost...]
I get in my browser The requested URL /~name/testsite/contact was not found on this server.
Error log says: [Mon Jan 26 14:55:56 2009] [error] [client ::1] File does not exist: /Users/name/Sites/testsite/contact, referer: [localhost...]
When asking for [localhost...]
I get in my browser the right page
Error log says: nothing
When i ask for [localhost...] (with or without /)
i get in my browser "The requested URL / was not found on this server."
Error log says "[Mon Jan 26 14:58:23 2009] [error] [client ::1] File does not exist: /www" (I don't know where to put the www file, tbh)
[edited by: jdMorgan at 12:22 pm (utc) on June 16, 2009]
[edit reason] obscured details [/edit]
www.sitepoint.com/article/os-x-web-development/
foundationphp.com/tutorials/vhosts_leopard.php
www.macdevcenter.com/pub/a/mac/2003/04/08/mod_rendezvous.html
If you still have problems after you read these, let me know. I'll simplify my setting and post it here for you.
Steve
[edited by: jdMorgan at 4:38 pm (utc) on Jan. 27, 2009]
[edit reason] De-linked [/edit]
Please do not post links to your own sites, non-authoritative sites, or to blogs or forum posts which may disappear over time.
The purpose of this forum is not to serve as a 'free help desk' or 'free coding service' but rather as a discussion forum; Because of this, links which go bad over time have the effect of making older (and previously-very-useful) threads become worthless, devaluing the time that members have taken to contribute to them.
There are other issues involving protecting WebmasterWorld members' safety, and protecting the target sites' search engine listings as well. Also be aware that all links must be vetted, and this means taking extra time and exposing our computers and networks to potentially non-trivial risks.
Therefore, we strongly prefer that posts here remain entirely self-contained, with minimal external dependencies; Whenever possible, please post relevant information directly in the thread itself.
We now return you to your regularly-scheduled programming...
Thanks,
Jim