Symbolic Links Not Working


I have installed MySQL on my VPS and am trying to set up phpMyAdmin. I then ran the following commands, first installing phpMyAdmin and then trying to create a symbolic link to it in a web-accessible directory.

$ apt-get install phpmyadmin
$ cd /home/username/
$ ln -s /usr/share/phpmyadmin

However, when I navigate to, I get a 403 Forbidden error. The permissions for the soft link are lrwxrwxrwx, for the /usr/share/phpmyadmin directory are drwxr-xr-x, and for /usr/share/phpmyadmin/index.php are -rw-r–r--.

Does anyone know why I’m getting a 403 Forbidden error and how to fix it?

[Note that the text of this question also appears in the Curious About DreamHost forum but I’m not double posting — there I’m asking about my interaction about tech support, not about the issue itself.]

One thread at a time is enough.

The issue you’re running into is that, with our standard configuration, Apache will refuse to follow symbolic links to files owned by another user. (This is so that, on a shared hosting server, you can’t read another user’s files by linking to them.) Since /usr/share/phpmyadmin is owned by root, you can’t link to it.

If you feel like editing your server’s main httpd.conf, you can add an Alias directive there, like the default one we’ve got for dh_phpmyadmin. (Alias directives can’t be placed in .htaccess files, only in the main web server config.) Note that you’ll have to disable DreamHost management of the web server configuration to keep this in place, as otherwise your changes will be overwritten when we automatically reconfigure the web server (e.g, when you add or edit a domain).

Oh sorry for not replying sooner, I thought I subscribed to e-mail updates, but I guess not.

I see this is the verbatim answer that tech support gave, so I’m guessing the problem has come up before. I didn’t want to disable DreamHost management (since that would kinda defeat the purpose of using DreamHost instead of, say, Linode) and I tried using chown to change the owner of /usr/share/phpmyadmin and all subdirectories/files to the username with the link, but that still didn’t work. Any idea why?

And don’t worry; as I said, the other thread was about a different aspect of the question, regarding my interactions with tech support. However, I can no longer find the other thread — did you or another moderator remove it?