mod_rewrite, and another, possibly related, error

Hi, all.

Trying to set up Omeka on our University DH server to do a project on the burning of Columbia, SC near the end of the Civil War. I've got root access. The server is running Ubuntu 14.04. I follow the instruction outlined at http://omeka.org/codex/Install_on_Ubuntu_using_Terminal with just a few differences:

1—Wherever it says /var/www, I go /var/www/burning (there are several other projects on the server, each with their own directory in /var/www).
2—For step three, there's no index.html in /var/www, so I skip that step.
3—I wget and unzip omeka-2.2.2.zip, instead of 2.0.
4—There is no file called default in /etc/apache2/sites-available, so instead I make changes to /sites-available/000-default.conf

I can't get mod_rewrite turned on, and therefore can't install. I've tried adding

<Directory /var/www/burning>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
to both /etc/apache2/apache2.conf AND /etc/apache2/sites-available/000-default.conf. I've tried it with both, and I've tried it with only one.

Rewrite shows up as one of the modules in /etc/apache2/mods-enabled. I'm restarting Apache after every change to a configuration file, all to no avail. I made a backup of /etc/apache2 before I started, and even wrote that backup over what I had modified, to give me a clean start, then tried again. Nothing doing.

I've tried fixes outlined in some other posts, and I keep running into the same error.

Another, possibly related issue: if I try to navigate to [myserver]/burning/install/install.php to try to work around this, I get told I don't have access to write the files; this despite the fact that I'm in the group that owns /var/www/burning and that directory has permissions 775.

Thanks for any help!

On your own server, it usually doesn't matter that you have access to the files, at least not for whether you'll get a permissions error.

You need to make sure Apache has access to write in those folders. For 775 permissions, that usually means those folders need to belong to a group that the Apache user is in.

Great, thanks. I'll look into that when I'm back at work Monday--firewall won't let me ssh in from a non-university IP.

Should I just see if I can work around the install by using the install.php script, and not worry with the mod_rewrite fixing, then?

If mod_rewrite actually isn't enabled, the site won't work, and you'll only be able to go to the "front" pages of each side (the homepage and the admin dashboard).

However, the installer complaining about mod_rewrite is sometimes a false positive, particularly on new-ish Ubuntu installs, which use a version of Apache that has a bug in how .htaccess stuff gets processed that affects our installer's check.

Given that, it's probably worth it to try to push through with the install.php workaround and see what happens.

Thanks! Lookign forward to trying this out on Monday.

Well, I fixed the ownership issues, and was able to use the php script to install Omeka. But I'm getting 404 errors now. I tried the solutions outlined on http://omeka.org/forums/topic/every-link-leads-to-404#post-105945, all to no avail.

Here's the text of my /etc/apache2/apache2.conf:

https://www.pastee.org/85unu

And here's the text of my /var/www/burning/.htaccess:

https://www.pastee.org/dvsed

I'm probably getting mixed up on something simple, I know. Again, the project I'm working on is in /var/www/burning; there are several other projects also located at /var/www, so I'm hesitant to do things that might cause problems with those projects.

Thanks!!

Your RewriteBase is wrong.

That value gets based on the URL to your site, not the local directory path. Generally, you want to set RewriteBase to the part of the URL to your site that comes after the domain.

That fixed it! Thanks!

Reopening this thread, as I've been tasked with migrating to a new server and I'm hitting a lot of the same issues all over again.

So I've made a backup of my database, got all my files from the old server saved, etc. I'm going to copy all of those over and merge the database AFTER doing a fresh install of Omeka.

I go and do all of that as I've learned to do, but I keep getting errors like the one above, that indicates I've got mod_rewrite problems. I've set the RewriteBase as John Flatness indicated a couple of months ago, but I'm getting a 404 on MYSITE/admin/users/login. Thus, I can't login and can't do, well, anything.

A possible issue I can think of: on the new server, the install isn't in /var/www, but rather in /home/myaccount/public_html. There's a symlink in /var/www that points to /home/myaccount/public_html

Any ideas?

Figured it out. Needed to add:

<Directory "/var/www/html">
AllowOverride All
</Directory>

in /etc/apache2/sites-available/000-default.conf in apache 2.4/Ubuntu 14.04. Just version differences, etc.