Article:
  Apache Web-Serving with Mac OS X: Part 1
Subject:   configuration httpd.conf
Date:   2001-12-10 12:08:53
From:   loren3
Response to: configuration httpd.conf


no doubt... i learned from this page that i had to type:


http://<myip>/~myshortname


i had been frustrated that i was typing just http://<myip> and I was getting the apache default page even tho i had already replaced the index.html file in my ~/Sites/ folder.


so that clarified that much.


but what if you don't want to use your short name? how do you reconfigure it so that:


a) it goes straight to your user index.html file with http://myip (without having to build your site in the /Library/WebServer directory...)


or


b) create some kind of alias so that each user can have his/her own page but not necessarily use their short name to define it, as in:


http://myip/~animals (for the site owned by user "morbus") and http://myip/~cars (for the site owned by user "Joe")


thanks.....


also, is there ANY decent WYSIWYG html editor for OS X??


and... How do you use BBEDIT to create a simple go to blah link???? believe it or not I couldn't figure that out.


Full Threads Newest First

Showing messages 1 through 6 of 6.

  • Morbus Iff photo configuration httpd.conf
    2001-12-10 12:50:02  Morbus Iff | O'Reilly Author [View]

    loren3, to answer your questions:

    a) It's possible. Probably the quickest way to do so is to go into your httpd.conf file, search for "/Library/Webserver/Documents" and replace it with the full path to your user directory. When you see a line that says something like "<Directory /Library/Webserver/Documents>", then that's the place you want to change. Messing around with the httpd.conf is touched upon in later parts of this series.

    b) Possible, but will not be touched upon in this series of articles. Generically speaking, the "~" is special in the sense that it denotes a username - if you really wanted "animals" and "cars" owned by separate users, then you should just do http://myip/animals/ and http://myip/cars/. That's left for you to figure out though.

    As for WYSIWIGs, dunno, never used them. As for BBEdit, this is the wrong place to ask ;) ...
    • configuration httpd.conf
      2001-12-10 13:20:33  loren3 [View]

      - if you really wanted "animals" and "cars" owned by separate users, then you should just do http://myip/animals/ and http://myip/cars/. That's left for you to figure out though.

      ...sorry i can't figure that out... that's why i came here looking for clues, not being a web admin or anything.

      my only guess is that you would have to set up some kind of redirect from a main page. but i don't know enough about either that level of html or about relative path names to figure that out.

      i've already run into problems trying to link to images outside of the sites folder (even in the ~/Pictures/ directory!) with relative pathnames and apparent lack of privs.

      -g



















  • configuration httpd.conf
    2001-12-10 13:36:09  djwudi [View]

    Since BBEdit is 'just' a text processor, the easiest way to put a link in is to just type the HTML code for the link in. Since you added the link to go to blah link to your post, I'm assuming you know that much HTML code, so it should work fine.

    Don't know about WYWIWYG editors, though - personally, I've never liked them. I've been coding my site with BBEdit, Pepper (another OS X text editor), or vi ('cause I'm a glutton for punishment) long enough that I've never liked any WYSIWYG editor I've played with.

    For pages under URLs such as http://yourip/animals/ or http://yourip/cars/ and such, those would just be subdirectories within...well...

    (My apologies if I'm jumping ahead in the lessons here...)

    As morbus said, the url http://yourip/~yourname/ points to your /Users/yourname/sites/ directory. However, the base url http://yourip/ points to the /Library/WebServer/Documents/ directory. Creating a subdirectory called 'cars' in there would give a system path of /Library/WebServer/Documents/cars/ that would be accessible from the outside as http://yourip/cars/ and would display whatever was inside the 'cars' directory. That's the easiest way that I can think of. The user (Joe, in your example) would still have to navigate to that folder rather than having it residing in his home directory...but if you really wanted to then, I suppose some creative aliasing could take care of that.
    • configuration httpd.conf
      2001-12-11 15:25:50  loren3 [View]

      thanks for the reply...

      with regard to subdirectories issue:

      1. i would want to avoid users--including myself once i got apache set up--from mucking about in the /Library directory! not a good idea IMHO.

      2. i've had terrible experience with aliases when it comes to system files in OS X, such that my principle is don't do it. i created some hard symbolic links and mucked things up badly before.

      3. i did find a suitable solution, which is to create an account with www.dyndns.org and set up free domain names linked to your ip (or dynamic ip). then you can set up the httpd.conf file to use virtual hosts, which is pretty easy to do. so each user can have his/her own domain name and have that go to anywhere it his/her user directory.

      with regards to bbedit, yeah sure i can code a simple link. but so what? bbedit has a whole markup toolbar to do nifty things wiht GUI like inserting inline images. The one thing I can't figure out immediately is how to create a link with that toolbar.

      unlike many hardcore html coders, i'd rather use dialog boxes than manually do all the tags.

      • configuration httpd.conf
        2002-02-02 12:32:22  mac_yoda [View]

        Where are all the BBEdit users?

        Hit the "Anchor" or the "Image" buttons in the "HTML tools" bar to get the dialogs you are looking for.
  • configuration httpd.conf
    2001-12-10 14:28:38  bbicapslock [View]

    Straight to user index file:

    Change <Directory "/Library/WebServer/Documents"> to <Directory "/Users/whatever/Sites"> ("whatever" should be replaced by your short name.)

    Different users to different pages:
    If it's not going to be systematic then you'll need one line for each user. One way to do it is to use alias, for example, to alias cars and Joe from your example.

    You could also create some rewrite rules and let mod_rewrite take care of it.

    (Check the apache doc files shipped with OSX for syntax.)