• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

mod_rewrite not working after upgrading Ubuntu 12.04LTS to 14.04LTS

FileGuide

Chevereto Member
I just wrapped up upgrading my OS from Ubuntu 12.04LTS to Ubuntu 14.04LTS and suddenly it seems as if Chevereto and mod_rewrite are not cooperating. This webserver simply runs apache2 with Cloudflare, with no other local proxy services in the middle of the configuration, and the issue still persists even if I access the webserver's IP directly without Cloudflare in the middle.

Specifically what is broken is the short URLs and image uploading either via the web or the API. I am able to browse to the long-form URL so I don't believe its a permissions issue as I ran "chown www-data:www-data /var/www/ -R" just to be sure (/var/www/ is where is my DocumentRoot).

mod_rewrite is definitely enabled:
root@img:/var/www# apachectl -M | grep rewrite
rewrite_module (shared)


In /var/www/.htaccess everything looks the same as it did prior to the OS upgrade:
# Disable server signature
ServerSignature Off

# Disable directory listing (-indexes), Multiviews (-MultiViews) and enable Follow system links (+FollowSymLinks)
Options -Indexes
Options -MultiViews
Options +FollowSymLinks

# Turn on mod_rewrite
RewriteEngine On

# If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
RewriteBase /

# The /api rewrite
RewriteRule ^api$ api.php [L]

# If you want to have your own fancy "image not found" image remove the "#" from RewriteCond and RewriteRule lines
# Make sure to apply the correct paths to reflect your current installation
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule images/.+\.(gif|jpe?g|png|bmp) content/system/img/404.gif [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.([a-z]{1,4})$ [NC]
RewriteRule . index.php [L]


Same thing with /var/www/images/.htaccess:
<Files .*>
order allow,deny
deny from all
</Files>

AddHandler cgi-script .php .php3 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi .fcgi
Options -ExecCGI

/etc/apache2/sites-enabled/img.MyDomain.com.conf looks normal too: (redacted IP and Domain from below for personal privacy)
<VirtualHost ***.***.***.***:80>
ServerAdmin *********@********.com
ServerName img.********.com
DocumentRoot /var/www
ErrorLog /var/www/logs/error.log
</VirtualHost>


The only thing I changed besides the OS upgrade was /etc/apache2/sites-available/mydomain.com to /etc/apache2/sites-available/mydomain.com.conf as the newer apache2 wants the .conf at the end of the site's configuration file in order to enable to site as such: a2ensite mydomain.com.conf

Please kindly advise if there is anything I can do to get my image host back online as I am completely at a loss for answers and the closest thing I could find was a wjunction post where the only responses were one from some bonehead who said Chevereto is a terrible image hosting script and another from someone who said to PM him on Skype (probably to charge him for support)... :\
 
Seems that you are missing AllowOverride All in your virtualhost.
 
So I thought I have resolved this but unfortunately I haven't :(

Manual web uploads seem to work, but when I use the public API for the script to upload I encounter permissions errors. The files uploaded via the API are definitely on the image webserver and have a chmod level of 655, they are also owned by www-data:www-data

When I click on the short link (img.hostname.com/ABCD) I get this:
Not found (404)
The server can't find the requested page.


and when I try to open the thumbnail image itself I get this:
Forbidden
You don't have permission to access /images/2014/04/22/somefilename.th.jpg on this server.



and the full image itself:
Forbidden
You don't have permission to access /images/2014/04/22/somefilename.jpg on this server.



Here is my apache virtualhost config:
<VirtualHost ***.***.***.***:80>
ServerAdmin *********@********.com
ServerName img.********.com
DocumentRoot /var/www
<Directory /var/www/>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/yoursite_error.log
LogLevel warn
CustomLog /var/log/apache2/yoursite_access.log combined
ErrorLog /var/www/logs/error.log
</VirtualHost>
 
Hmm, I just tried to use the API URL path in a browser, and this is the error I get from Chevereto:
{"status_code":403,"status_txt":"invalid mime"}

Keep in mind that the only thing I did to this server was upgrade it from Ubuntu 12.04 to Ubuntu 14.04

No changes to any DNS or configuration file were made (except for adding .conf to the end of the configuration file's name).

Chevereto worked perfectly fine for months on end with this server too. I'm pretty disappointed that this happened :(
 
OK, I just figured that out, it was the fact that I did chmod 655 on the images folder, went back and recursively chmod 777 the images subfolder and the api upload is now working again :)
 
Back
Top