Hot answers tagged

15 votes

How do I configure Varnish to work with Craft?

Ok, Carlo, I'll get in this improved answer tonight, anyway, probably cut down and informate the other answer in morning here, so comments stay. I've got a sick animal here house-sitting for brother &...
user avatar
  • 1,697
13 votes

All images uploading... except JPG files

I had this same issue and resolved it (at the suggestion of Craft CMS support) by enabling ImageMagick in the php.ini and restarting MAMP PRO. Per the MAMP PRO 3.0 user guide: The ImageMagick PHP ...
user avatar
  • 418
12 votes
Accepted

Can I run one Craft install on multiple domains and/or subdomains?

Update for Craft 3 Craft 3 includes native support for multi-site installation. Here's a link to the official docs and here's a link to another question with more resources. Old answer for Craft 1 &...
user avatar
  • 2,985
11 votes

What is the recommended Nginx configuration for Craft?

Definitely not an nginx expert, but this has been working well for anyone that's tried it so far: server { listen 8080 default; charset utf8; server_name example.com; root /path/to/example....
user avatar
  • 66.5k
10 votes
Accepted

What's the configuration to enable Craft for free CloudFlare and Railgun?

I'm going to answer this one, to share information on how I just did it. One issue will remain, but that will be raised in a separate question. The first thing is to understand the URL layout which ...
user avatar
  • 1,697
10 votes

Can I run one Craft install on multiple domains and/or subdomains?

Yes, it is possible to have a Craft install on multiple domains and subdomains as long as you only access the control panel from a single domain and you only have a single installation of craft that ...
user avatar
  • 6,682
8 votes

Mcrypt is required on Ubuntu 14.04

I had to run sudo php5enmod mcrypt to enable the module. It seems this has changed between 12.04 and 14.04—in 12.04 it was enabled automatically.
user avatar
8 votes
Accepted

Adding cache headers to Nginx configuation file breaks the /admin area

Craft rewrites the location of those files using a query string, which is what's causing nginx to lose track of them. Using the try_files directive should force nginx to find and serve them properly. ...
user avatar
8 votes
Accepted

Getting $craftPath error on server trying to get Craft running

9 times out of 10, if you're absolutely sure the path is correct, it's either a permissions issue (PHP doesn't have permissions to open the craft folder) or your php.ini file has open_basedir ...
user avatar
  • 66.5k
8 votes

All images uploading... except JPG files

I had the same issue and solved it. This seems to be an issue with the exif lib. Try to disable mbstring overloading by setting mbstring.func_overload = 0 to your php.ini or php_admin_value ...
user avatar
  • 81
8 votes

What are useful guidelines for Craft CMS security on VPS (virtual private servers)?

This morning a couple of postings on Craft Slack #devops area linked good descriptions of basic server security, led by @merlingore there. Their instructions are tilted towards Ubuntu as far as ...
user avatar
  • 1,697
7 votes
Accepted

Website taking 30+ seconds to load

There is a reasonable chance that this is due to a specific plugin. Try disabling all of your plugins, and see if the site is loading quickly again. If it is, try re-enabling each plugin one by one, ...
user avatar
  • 23.6k
7 votes
Accepted

Are there any intentions to release multisite support for Craft?

Currently multi-site support isn't planned. If you want simple multi-site-support you could use the localization feature with a custom locale. But with Craft's auto-update's and easy deployment, why ...
user avatar
  • 8,326
7 votes

Server respond is very long (25s). Is there a way to optimize the perfomance?

Let me try to turn this into a more valuable StackExchange for others who will find it, since the original poster apparently got help and solved his problem without participating here. We can see so ...
user avatar
  • 1,697
7 votes

How do I redirect traffic from a legacy category URL to a new category URL?

There are a few plugins which can handle this, but Retour is the newest and shiniest! https://github.com/nystudio107/retour It's from the same developer as SEOmatic... he puts a lot of love & ...
user avatar
  • 23.6k
6 votes
Accepted

What is the recommended Nginx configuration for Craft?

This Nginx-Craft configuration is one I've been using in production for some time, and it implements many best-practices that you might want to be using: https://github.com/nystudio107/nginx-craft
user avatar
6 votes
Accepted

How do I redirect traffic from a legacy category URL to a new category URL?

Craft has a twig redirect tag. You should be able to create a "redirect" template that handles redirects based on {slug} and/or url segments and then use Craft routes to direct "legacy-subdirectory"...
user avatar
5 votes

Can Craft easily be hosted across multiple servers?

Entirely possible. There is some discussion of having Craft installed in a load-balanced environment here. You'll want to have CRAFT_STORAGE_PATH point to a shared file system for all servers. If ...
user avatar
  • 66.5k
5 votes
Accepted

Steps to publish a craft website from local to server

It probably depends most on your hosting but following these instructions are probably your best bet: http://buildwithcraft.com/docs/installing The only exception being instead of "installing" you'd ...
user avatar
  • 1,685
5 votes
Accepted

Craft hangs when updating entry

It turns out that I was running a dev release of PHP 5.6 from a PPA and not the official Ubuntu release. With Brad Bell's help (thank you so much!) I got on the right track to looking into PHP and ...
user avatar
  • 346
5 votes
Accepted

Running Craft alongside another CMS on the same domain

You're asking a loaded question. I don't think there's a wrong answer here but if it were me, you have a couple options. Addressing the Elephant in the Room How good of a salesman are you? ;) You ...
user avatar
  • 6,477
5 votes
Accepted

Installing other PHP app in sub directory

Yes, possible. You just need to override the URL routing within the subdirectory, so requests to /sub/* get routed to /sub/index.php rather than /index.php. For example, if you’re using Apache, just ...
user avatar
5 votes

Self-hosting requirements/scaling

No reason at all, that should work perfectly fine. In fact, at least 90% of my projects keep files, database, and assets all on the same server. For the remaining 10%, I'm usually only moving the ...
user avatar
  • 23.6k
5 votes
Accepted

Problems setting up a local site

You can't use the domain .dev anymore, it's Google's gTLD (https://icannwiki.org/.dev) and they don't want to share. See https://medium.engineering/use-a-dev-domain-not-anymore-95219778e6fd for a ...
user avatar
5 votes
Accepted

Craft 3: 500 Internal Server Error when trying to install on server

The 503 error on the home page usually indicates that Craft can't connect to the database. That's to be expected when performing a fresh installation. The internal server error could be a typo or ...
user avatar
5 votes
Accepted

Undefined index: siteSettings when updating entry types

Even with 'useProjectConfigFile' => false, it is still active under the hood. Could you run ./craft project-config/rebuild and see if that fixes the issue?
user avatar
  • 7,200
4 votes
Accepted

Installation stops halfway. Files not found and internal server error 500

The log file got me on my way after a tip from Brad Bell: 'CDbException' with message 'CDbCommand failed during the SQL statement: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '...
user avatar
  • 1,042
4 votes

What is the recommended Nginx configuration for Craft?

craftcms.conf root /srv/http/current-release/src/public; index index.php index.html index.htm; charset utf-8; # Force the latest IE version add_header "X-UA-Compatible" "IE=Edge"; error_page 404 /...
user avatar
  • 41
4 votes

How do I configure Varnish to work with Craft?

As requested, here's a Varnish (3.x) configuration we use: https://gist.github.com/timkelty/35625a90a6819c8f7927 This is one setup for ExpressionEngine, but the only thing there really specific to ...
user avatar
  • 3,061
4 votes

How do I configure Varnish to work with Craft?

[Edit: I'm deprecating this answer, having a better one up now I believe, but leaving it as it's attracted very useful comments. I think what's said here isn't quite wrong, but has been considerably ...
user avatar
  • 1,697

Only top scored, non community-wiki answers of a minimum length are eligible