Berkeley CSUA MOTD:Entry 53745
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2018/01/22 [General] UID:1000 Activity:popular
1/22    

2010/3/8-30 [Computer/SW/Unix] UID:53745 Activity:nil
3/8     I have a mod_rewrite question that I think should be straight-
        forward but I think I'm not getting something.

        I have a virtual server with some root, say /home/user/public_html/
        and in there I have two subdirs, say /app1/ and /app2/
        and i want the following:
        http://mysite/app1   -->   /home/user/public_html/app1
        http://mysite/(.*   -->   /home/user/public_html/app2/$1
        so for ex, http://mysite/app2   -->   /home/user/public_html/app2/app2

        So anything that's not "app1" would map into the app2 subdir ...
        but I guess this causes an infinite loop in the processing? Since it
        just keeps prefixing /app2/ onto the path until it crashes? any
        advice? thx -
        \_ IIRC it matches in order. However, the way you have it, it looks like
           http://mysite/app1 or http://mysite/app1/(.* might not be matched by
           your first rule. Perhaps "http://mysite/app1(/.*)?" or something may
           work better (untested though, but you should get the idea)
           \_ ok sure you're right. But my main question is how to get the
              2nd rule to work w/out generating an infinite loop. ie,
              http://mysite      should go to  home/user/public_html/app2/
              http://mysite/foo  should go to  home/user/public_html/app2/foo
              http://mysite/app2 should go to  home/user/public_html/app2/app2
              etc, but w/out infinite loop. possible? thx
                  \_ Oh, I see. You probably want
                     http://mysite/app2 -> /home/user/public_html/app2/
                         as a separate rule, or perhaps...
                         http://mysite/([^/]*)(/.*?) -> /home/user/public_html/app2/$1$2
                         ...maybe? I don't know why it would be rewriting it to a path on
                         your filesystem...it's been a while, but I thought it rewrote
                         URLs, not filesystem paths. I'm just guessing...
        \_ set your root to app2. then alias /app1. no mod_rewrite.
           \_ hurr durr that would make too much sense. D'oh. --!op
2018/01/22 [General] UID:1000 Activity:popular
1/22    

You may also be interested in these entries...
2012/9/20-11/7 [Finance/Investment, Computer/SW/Unix] UID:54482 Activity:nil
9/20    How do I change my shell? chsh says "Cannot change ID to root."
        \_ /usr/bin/chsh does not have the SUID permission set. Without
           being set, it does not successfully change a user's shell.
           Typical newbie sys admin (on soda)
           \_ Actually, it does: -rwsr-xr-x 1 root root 37552 Feb 15  2011 /usr/bin/chsh
	...
2012/5/8-6/4 [Computer/SW/Unix] UID:54383 Activity:nil
5/8     Hello everyone!  This is Josh Hawn, CSUA Tech VP for Spring 2012.
        About 2 weeks ago, someone brought to my attention that our script
        to periodically merge /etc/motd.public into /etc/motd wasn't
        running.  When I looked into it, the cron daemon was running, but
        there hadn't been any root activity in the log since April 7th.  I
        looked into it for a while, but got lost in other things I was
	...
2012/2/9-3/26 [Computer/SW/Security, Computer/SW/Unix] UID:54305 Activity:nil
2/9     Reminder: support for mail services has been deprecated for *several
        years*. Mail forwarding, specifically .forward mail forwarding, is
        officially supported and was never deprecated.
        \_ There is no .forward under ~root.  How do we mail root and how do
           we get responses?
           \_ root@csua.berkeley.edu is and always has been an alias.
	...
2011/9/14-12/28 [Computer/SW/Unix] UID:54172 Activity:nil
9/12    We've restored CSUA NFS to something vaguely resembling normal
        functionality -- plus, with some luck, we should now have something
        vaguely resembling normal uptime, too!  Ping root@csua.org if you
        notice any problems.  --jordan
--------------------------------------------------------------------------------
        \_  Oh, and http://irc.CSUA.Berkeley.EDU is online again.
	...
2011/9/14-10/25 [Computer/HW/Drives] UID:54173 Activity:nil
9/13    Thanks to Jordan, our disk server is no longer virtualized. Our long
        nightmare of poor IO performance should hopefully be over. Prepare for
        another long nightmare of poor hardware reliability!
        ...
        Just kidding! (I hope)
        In any case, this means that cooler was taken out back and shot, and
	...
2011/6/5-8/27 [Computer/HW/Memory] UID:54127 Activity:nil
6/5     In an effort to stabilize our services, we'll be rebuilding parts of
        the CSUA infrastructure over the course of this summer.  To give us
        some wiggle room, I've temporarily decreased soda's allocated RAM from
        8GB to 2GB.  If you need to run something that requires large amounts
        of memory, please send mail to root@csua.org and we'll try to
        accommodate your request.  --jordan
	...
2011/4/27-7/30 [Computer/SW/Unix, Computer/SW/Security] UID:54096 Activity:nil
4/28    Will wall be fixed?   - jsl
        \_ What's wall?
           \_ An anachronism from a bygone era, when computers were hard to
              comeby, the dorms didn't have net, there was no airbears, and
              when phones didn't come standard with twitter or sms.
           \_ A non useful implementation of twitter.
	...
2011/5/19-7/30 [Computer/SW/Security] UID:54110 Activity:nil
5/19    Uh, is anyone still using this? Please mark here if you post and
        haven't added this yet. I'll start:
        \_ person k
        \_ ausman, I check in about once a week.
        \_ erikred, twice a week or so.
        \_ mehlhaff, I login when I actually own my home directory instead of
	...
2010/12/13-2011/2/19 [Computer/SW/Unix] UID:53978 Activity:nil
12/21   Help, all my files are owned by nobody! -ausman
        (yes I emailed root)
        \_ Things should be fine now. As usual, the NFS server caused a cascade
           of errors.
	...
Cache (60 bytes)
mysite/app1
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/(.*
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/app2
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/app1/(.*
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/app1(/.*)?"
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/foo
Use the link on the right to sign up for your FREE Web site.
Cache (60 bytes)
mysite/([^/]*)(/.*
Use the link on the right to sign up for your FREE Web site.