Hi,
I'm in the process of building a linode 512 nginx-based server, and am in need of advice. My end goal is for the server to host a number of course sites for college writing courses. The sites are drupal 7 based, and use a decent number of modules:
Chaos Tools
Panels
Views
Workflow
Editable Fields
Private Messaging
Organic Groups
Heirarchical Select
Entity
Token
Menu Token
Switchtheme
Webform
Date
Calendar
The sites are going to be used concurrently by around 22 users at a time on average for maybe an hour at a time, per site. The site does rely pretty heavily on views for content, as I've built in a lot of firewalls for FERPA compliance of student data. I'm hoping to cache as many of these as I can and to make sure reasonable requests are made of the views so they don't get pulled as a whole on a regular basis. Students will be creating content during this time, usually one node per student, and instructors will be doing minimal creation. The sites will be pretty data heavy by the end of a semester, but will then be nuked/rebuilt, so they won't be continually accruing data over years.
For the past two years I've been installing and running the Drupal-based course sites for my department, but it was on a heavily-managed Stormondemand server. I'm moving to the linode as I'll be graduating soon and want to move my work to my own server for further development. I'm new to setting up servers, and chose linode as a way to learn the ropes and have freedom that other hosts didn't offer. I have a 512 linode.
I'm wondering if there are any suggestions (or good resources) folks might think would be relevant, as well as any ideas what type of performance I might expect to aim for (number of sites, etc). I've never set up apache by hand, so I'm basically cutting my teeth on nginx, and I figure that's a good thing as I don't have to unlearn any apache-specific habits.
Thanks!
Vidus
Comments
At this point, I've installed
At this point, I've installed mysql, php5-fpm, and nginx.
The only thing I installed extra besides that list was php5-mysql, so I'm not sure if I need any other packages to get this running or not.
Would I be safe using the installation at https://github.com/perusio/drupal-with-nginx ?
Yes
It is. Note that this is a config that is more or less advanced. You must read the docs and the comments in the code.
Alright, thanks. I'll start
Alright, thanks. I'll start pouring through it. My goal is to get a good working knowledge of the set-up and to start tweaking it for performance.
I'm in the process of going
I'm in the process of going through this config, and was wondering if (dumb question I'm sure) I need to stipulate my subdomains for every instance of server_name in the .conf file for my URL. And, if I need to duplicate logs for those locations as well. This is my first time setting up nginx's .conf and wasn't really sure and having a hard time figuring that out. (though I've got a basic grasp of the cascading blocks idea)
Sounds like
Sounds like http://community.aegirproject.org/content/installing/manual/nginx-mariad... would be a good guide for you. I wrote that doc page, so feel free to contact me if you need any help. That setup should work very well on a 512 box with Linode.
Plus, you get to use Aegir :)
--
Cameron Eagans
http://cweagans.net
I"ll look into it as well.
I"ll look into it as well. Aegir is of interest to me in the middle term at least. I'm starting rather low on site numbers, but eventually I'd like to scale up quite a bit (scale server too) and Aegir would be a good tool to facilitate that.
Additional question: I'm
Additional question:
I'm going to be using two domains, one for my personal website and another for the project I'm hosting. I'd like this install to be as light as possible, and was wondering if Aegir could handle them both from one installation of Aegir or if I need more than one. (I'll start digging through the main Aegir site at this point).
Thanks again for your help.
You need to qualify that
IMHO the lightest possible solution is to leave it all to the server and use PHP only when needed.
Aegir is a multisite tool. Meaning that your Nginx
server_namedirective will have as many hosts as there are hosts managed by aegir. All requests are forwarded to Drupal than then resolves each domain to it's own theme and set of modules while making use of a common set of modules. This is based on theHostheader.I happen to believe that handling host routing at the app layer is not the most optimal thing and sort of a hack. But if you're comfortable with that, carry on.
The upside is that you get a way to manage your sites that is integrated with drupal. Like in all engineering questions, there's no this is the way. Try both and see what works best for you. On doubt use lazyness as the main criteria ;)
I happen to believe that
I'd like to point out that Drupal does this anyways, regardless of if you're using multisite or not. See http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/inclu... and http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/inclu...
In fact, if you don't have a directory specifically for your site (ex: sites/yoursite.com/settings.php), Drupal will go through every possible permutation of the URL (com, yoursite.com, yoursite.com:80), checking to see if directories exist. Then, finally, if none of those directories exist, then it will use default.
So using the multisite feature of Drupal will save you a few calls to file_exists().
Also, if you're using multisite + APC, then only one copy of the PHP opcodes will be cached. It's a memory savings.
--
Cameron Eagans
http://cweagans.net
Yes but
that logic is there in order to have multisite support.
Yes, and it's very very
Yes, and it's very very useful. The gains with APC are worth it.
--
Cameron Eagans
http://cweagans.net
No
"Aegir is a multisite tool. Meaning that your Nginx server_name directive will have as many hosts as there are hosts managed by aegir."
That is not true, sorry.
You should check how it is done in Aegir before posting such misleading statement. Please do check and correct your horrible mistake :)
FYI: Aegir manages separate vhosts per site, so it never uses the same
server_namedirective for different sites, only for aliases, if used, as every site has its ownserver {}config. This means that sites are already separated on the Nginx layer, while Drupal will perform all its checks anyway, also when you don't use multisite at all.Yes my mistake
I was thinking in not in terms of aegir, but more in terms of a more generic as simple as possible multisite support with nginx.
Yes you can have separate vhosts for each site in your multisite setup. Is just that IMHO it goes against the putative simplicity of the multisite setup.
Fact is I don't like multisite ;)
Aegir is just a tool for
Aegir is just a tool for managing multisite installations. It works fairly well. One Aegir installation can manage an infinite number of sites on an infinite number of servers (you can set up different database and web servers, and when you install a site with Aegir, you choose what web server to set it up on, and what database server to use. It's quite nice.)
--
Cameron Eagans
http://cweagans.net
Thanks for all of the
Thanks for all of the explanations. Aegir does sound very close to where I'd like to eventually go with this project.
I am with perusio on this
I am with perusio on this one.. I tested Aegir and found it sort of useful in a development environment but I didn't like it for a production system.. Not without hacking at the code to make it work how I believe it should, and if I am going to be doing that it was easier to just create a few shell scripts and use Drush to achieve the platform I wanted..
Admittedly there is no GUI with this setup but if I want a multi-site web hosting interface I would use cPanel.. For a lean mean high performance webserver I don't need a GUI, even for multi-site.. At the end of the day this turns out to be much simpler to manage..
check out
check out BOA
http://groups.drupal.org/boa
Its like an optimised version of Ageir with one click install scripts.
http://geoff.com.au - http://redronin.com
If you go this route, I
If you go this route, I recommend editing the installation shell script and getting rid of the PureFTPd block. Seriously, if you're running an FTP server, you are asking to be hacked.
Other than that, BOA is pretty nice.
--
Cameron Eagans
http://cweagans.net
Are you aware that: BOA
Are you aware that:
?
I wasn't aware of that, but
SFTP is many many times better than FTP/FTPS will ever be, though. An FTP server is a relic of the past, and I personally refuse to run one, no matter what mode it's operating in :)
--
Cameron Eagans
http://cweagans.net
You don't need FTPS at all
You don't need FTPS at all when you don't do hosting for people, but you do need it when you do hosting (like it is with hosted Aegir), even when it is some micro-hosting.
The reason why we use FTPS is that it is easy to limit the secure access for extra users now managed by BOA automatically for every Client in Aegir using PureFTPd virtual chroot, while it is not possible to do that this way when you allow SFTP, so BOA allows SFTP only for Aegir instance owner while all extra accounts have only limited shell and FTPS.
"Seriously, if you're running
"Seriously, if you're running an FTP server, you are asking to be hacked."
I love these broad statements.. The fact that you are connected to the internet at all is "asking to be hacked" if you haven't put an adequate level of security and monitoring in place to reduce the likelihood of being hacked based on the risk profile and needs of the system..
You can't simply declare "No FTP" or anything else for that matter.. If a customer wants/needs it you provide it and then make sure you do what is needed to make it as secure as possible..
But this is a long way off topic..
Thanks! I will look into
Thanks! I will look into this one too.
Thanks for pointing out BOA.
Thanks for pointing out BOA. It ended up being the flavor of Aegir that made the most sense for my current and future plans, and it's been going great so far. Aegir on the whole has made my life so much simpler and I feel crazy for not looking into it sooner. I've been overseeing around 100 sites per semester the old fashion way and this will be a huge shift. I'm even looking into seeing if my boss would let me swap our current setup over to Aegir.
One thing I did extra on my
One thing I did extra on my BOA instalations is install s3fs on the backup folder so that site backups are stored off-server in s3.
Backup is an extended feature you have to turn on in the GUI.
http://geoff.com.au - http://redronin.com
Ok, thanks. I currently have
Ok, thanks. I currently have my backups set to run server-wide d/w/m frequency, but if/when I get another server or two, that would be a good idea.
Where do you turn backup on in Barracuda?
Where in the GUI do you turn backup on?
Hey, I built a vagrant box,
Hey,
I built a vagrant box, maybe could help you https://github.com/hackerhub/boxes
I don't think I"m familiar
I don't think I"m familiar with the term vagrant box.