Forums

Using Symlinks to point to themes (Mac, Apache) (12 posts)

  1. alexjamesbrown
    Member
    Posted 4 months ago #

    I've installed wordpress locally on my Mac (lion) After enabling vhosts, I've created an entry in my hosts file to point "wordpress" to 127.0.0.1

    My vhosts.conf contains:

    <VirtualHost *:80>
    DocumentRoot "/Users/alex/Sites/wordpress"
    ServerName wordpress
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    </VirtualHost>
    This works, and I can access the default wordpress install, no problem.

    Basically, inside my wp-content/themes folder, I've put a symlink to (for example)
    /Users/Alex/Projects/SomeTheme/

    This folder contains my theme files

    However, it's just not detecting the theme (doesn't show up in WP admin)
    If I copy the folder to wp-content/themes, then it works. Symlinks aren't being followed

    In my /etc/apache2/users/alex.conf I have:

    <Directory "/Users/alex/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

    I'm obviously missing something somewhere....

  2. Humor me, what happens when you visit this link?

    http://localhost/wp-content/themes/twentyeleven/readme.txt

    Do you get the readme.txt file or not authorized?

  3. alexjamesbrown
    Member
    Posted 4 months ago #

    404 on that exact url (i've not got it set up to just localhost)
    but if i visit:

    test.mysite.com/wp-content/themes/twentyeleven/readme.txt
    I get the content of the readme.txt

    test.mysite.com is setup in my hosts file to point to 127.0.0.1

  4. I was hoping it was just a pemission issue. Sorry, I thought you symlinked the whole wp-content/themes directory.

    Try test.mysite.com/wp-content/themes/SomeTheme/style.css which hopefully will show you the theme style.css file you expect to see.

    If the symlink is good but the webserver instance isn't permissioned to be able to read /Users/Alex/Projects/SomeTheme/ then I think you should get a 40x error of some kind.

    If it's that, then you may have to do some modification of directory and file ownership/permissions in /Users/Alex/Projects/SomeTheme/.

  5. alexjamesbrown
    Member
    Posted 4 months ago #

    indeed, i get 403 forbidden... so the symlink is working as you say....

    How should i (on a mac) make the changes to /Users/Alex/Projects/SomeTheme/
    ?

  6. My Mac Fu is a little weak on this, but I think if you select SomeTheme in the Finder then do command-i (that's the keyboard keystrokes..) you should get SomeTheme's info box.

    At the bottom of that box should be Sharing & Permissions. Click on the lock icon to be able to make changes.

    Select everyone and grant them Read & Write privilege. Click on the gears and Apply to enclosed items... After you confirm the changes, revisit that link and see if you still get a 403 error.

  7. alexjamesbrown
    Member
    Posted 4 months ago #

    yeah... i'd already given everyone r/w privileges :-(

  8. What about the files in SomeTheme directory such as style.css? If that's not it then my Mac Fu is just not strong enough.

  9. alexjamesbrown
    Member
    Posted 4 months ago #

    yep, they've all got the perms...
    i'm pretty sure i need to do something through the cmd line, just not sure what!

  10. *Cracks knuckles*

    You could try this: open up Terminal and then

    chmod 777 /Users/Alex/Projects/SomeTheme
    find /Users/Alex/Projects/SomeTheme/ -type f | xargs -I {} chmod 644 {}
    find /Users/Alex/Projects/SomeTheme/ -type d | xargs -I {} chmod 755 {}

    That will

    1. Make SomeTheme rwxrwxrwx (directories need the eXecute bit set to be able cd into them).
    2. Find all files in /Users/Alex/Projects/SomeTheme/ and make the readable by everyone.
    3. Find any directories in /Users/Alex/Projects/SomeTheme/ and make it so anyone can read the contents and be able to view into those directories.

    See if that works.

  11. alexjamesbrown
    Member
    Posted 4 months ago #

    didn't fix it... BUT

    I changed my httpd.conf - to use 'alex' as the service to run apache and it works...
    (it was _www before)
    totally insecure, i know... but for now, it'll do I guess

    Thanks for your help in pointing me to the permissions problem...

  12. totally insecure,

    Eh, that's not too bad. That Apache web server is listening only on 127.0.0.1 so to be compromised the attacker would already have to be on your Mac.

    So to compromise that Apache installation, you'd have to be compromised already! So it's all good. (It is only listening on 127.0.0.1 right?)

Reply

You must log in to post.

About this Topic