| | 1 | This page explains some things about the MFPL servers and how to use MFPL hosting tools to create and manage websites. |
| | 2 | |
| | 3 | This first draft is being written by Patrick Gibbs (and anyone who wants to) in December, 2012. |
| | 4 | |
| | 5 | First, appreciation for the MFPL support team! These fantastic humans do much of the nitty-gritty work of keeping this hosting infrastructure running. Learn more about the support team and see who's on it (though the list is a bit outdated) at [wiki:support-team Support Team]. |
| | 6 | |
| | 7 | So that you get an idea of why I find certain things seem worth mentioning about MFPL hosting -- my experience (says Patrick) includes the following: |
| | 8 | * setting up a Drupal + CiviCRM + Ubercart instance on cheap ($5/month) shared hosting. |
| | 9 | * administering a Moodle installation via the web interface. |
| | 10 | * doing basic command line work in GNU/Linux on my laptop. |
| | 11 | * writing a shell script once, and refining it. |
| | 12 | * playing with XAMPP when I used a Mac. |
| | 13 | I had very little experience with SSH, and had never used IRC. I joined May First / People Link in August 2012. |
| | 14 | |
| | 15 | |
| | 16 | == Understanding May First servers == |
| | 17 | |
| | 18 | === Start with the Members' Control Panel: === |
| | 19 | On previous hosting, I used cPanel. Here, there's custom software called `red` that runs a custom control panel. Look around and see what's possible. Things to notice: |
| | 20 | * On each page there's a line on the right side that says something like " Your primary host is: `marx.mayfirst.org (216.66.23.57)`". Knowing this enables connecting to the server via `ssh` (more on that later). |
| | 21 | |
| | 22 | Each website is a "hosting order": I currently have two hosting orders: one for my personal website, and one for an organization whose website I manage. Hosting orders are made automatically (I think, although maybe the |
| | 23 | |
| | 24 | === Connecting via ssh or ftp: === |
| | 25 | There are other pages that explain this in more detail ''(to do: find them and link to them)''. I do this: |
| | 26 | {{{ |
| | 27 | $ ssh patrickgibbs@marx.mayfirst.org |
| | 28 | }}} |
| | 29 | Wondering which server your site lives on? Look in the Members' Control Panel (see section above). |
| | 30 | |
| | 31 | I use Filezilla for FTP, and the connection details are the same as for ssh. |
| | 32 | |
| | 33 | === Welcome to your new `/home`: === |
| | 34 | Once logged in via ssh or ftp, you can look around and probably see something like this: |
| | 35 | {{{ |
| | 36 | 0 patrickgibbs@marx:~$ pwd |
| | 37 | /home/members/patrick0/sites/patrickgibbs.mayfirst.org/users/patrickgibbs |
| | 38 | 0 patrickgibbs@marx:~$ ls -Alh |
| | 39 | total 88K |
| | 40 | -rw------- 1 patrickgibbs patrickgibbs 3.6K Dec 7 17:29 .bash_history |
| | 41 | -rw-r--r-- 1 patrickgibbs patrickgibbs 220 Apr 10 2010 .bash_logout |
| | 42 | -rw-r--r-- 1 patrickgibbs patrickgibbs 3.2K Jan 30 2012 .bashrc |
| | 43 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Nov 29 01:00 .drush |
| | 44 | drwxr-xr-x 3 patrickgibbs patrickgibbs 4.0K Dec 5 23:57 .emacs.d |
| | 45 | -rw------- 1 patrickgibbs patrickgibbs 7.2K Dec 14 18:37 .histfile |
| | 46 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Jan 30 2012 .monkeysphere |
| | 47 | lrwxrwxrwx 1 patrickgibbs root 54 Aug 27 12:15 patrickgibbs.mayfirst.org -> /home/members/patrick0/sites/patrickgibbs.mayfirst.org |
| | 48 | -rw-r--r-- 1 patrickgibbs patrickgibbs 675 Apr 10 2010 .profile |
| | 49 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Jan 30 2012 .ssh |
| | 50 | drwxr-xr-x 3 patrickgibbs patrickgibbs 4.0K Sep 10 20:56 .subversion |
| | 51 | -rw-r--r-- 1 patrickgibbs patrickgibbs 34K Dec 2 22:14 .zcompdump |
| | 52 | -rw-r--r-- 1 patrickgibbs patrickgibbs 393 Dec 2 22:14 .zshrc |
| | 53 | 0 patrickgibbs@marx:~$ |
| | 54 | }}} |
| | 55 | You might not have`.drush`, `.emacs.d`, or `.zshrc` until you use emacs, drush, or zsh. |
| | 56 | |
| | 57 | Things to notice: |
| | 58 | * .monkeysphere has something to do with SSH fingerprints and encryption keys, I think. I haven't investigated yet. ''(to do: link to page about ssh connecting and fingerprints)'' |
| | 59 | * the website directory `patrickgibbs.mayfirst.org` is a symlink (symbolic link) that points up a few directories, and right now I'm already inside it, in my home folder, `~`. |
| | 60 | Let's look inside that website directory: |
| | 61 | {{{ |
| | 62 | 0 patrickgibbs@marx:~$ pwd |
| | 63 | /home/members/patrick0/sites/patrickgibbs.mayfirst.org/users/patrickgibbs |
| | 64 | 0 patrickgibbs@marx:~$ cd ../.. |
| | 65 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -Alh |
| | 66 | total 32K |
| | 67 | drwxr-x--- 2 root patrickgibbs 4.0K Nov 7 04:35 backups |
| | 68 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Aug 27 12:15 bin |
| | 69 | drwxrwxr-x 2 root patrickgibbs 4.0K Aug 27 12:15 cgi-bin |
| | 70 | drwxrwxr-x 4 root patrickgibbs 4.0K Dec 14 16:30 include |
| | 71 | drwxr-x--- 2 root patrickgibbs 4.0K Dec 16 06:26 logs |
| | 72 | drwxr-xr-x 3 root root 4.0K Aug 27 12:15 .red |
| | 73 | drwxr-xr-x 3 root root 4.0K Aug 27 12:15 users |
| | 74 | drwxrwxr-x 14 root patrickgibbs 4.0K Dec 7 17:15 web |
| | 75 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 76 | }}} |
| | 77 | ==== backups ==== |
| | 78 | I don't know what's in here. Probably backups... of what? |
| | 79 | {{{ |
| | 80 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -AlhR backups/ |
| | 81 | backups/: |
| | 82 | total 508K |
| | 83 | -rw-r----- 1 root patrickgibbs 190K Dec 16 01:33 patrickgibb_civi.sql.gz |
| | 84 | -rw-r----- 1 root patrickgibbs 89K Dec 16 01:33 patrickgibb_drup.sql.gz |
| | 85 | -rw-r----- 1 root patrickgibbs 188K Dec 16 01:33 patrickgibb_wprs.sql.gz |
| | 86 | -rw-r----- 1 root patrickgibbs 24K Dec 16 01:33 patrickgi_drup1.sql.gz |
| | 87 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 88 | }}} |
| | 89 | MySQL database backups so far. How did they get here? What's the schedule for backups? |
| | 90 | ==== bin ==== |
| | 91 | Don't know when I would use this. |
| | 92 | {{{ |
| | 93 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -AlhR bin/ |
| | 94 | bin/: |
| | 95 | total 4.0K |
| | 96 | -rwxr-xr-x 1 patrickgibbs patrickgibbs 123 Aug 27 12:15 php-cgi |
| | 97 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 98 | }}} |
| | 99 | ==== cgi-bin ==== |
| | 100 | I know this has something to do with websites. I've seen `cgi-bin` in URLs at other websites. Beyond that, I don't know. It's empty. |
| | 101 | |
| | 102 | ==== include ==== |
| | 103 | This directory is accessible by the `www-data` user (the Apache web server user, although '''most stuff gets executed by your user, not by www-data or some other Apache user'''). This is the place to put things that you want accessible by that user -- so far, the only thing I've put there is a `.htpasswd` file for a Trac instance. Looks like `php.ini` lives here too, and I remember editing that file a few times during past projects on other servers. |
| | 104 | {{{ |
| | 105 | 127 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -AlhR include/ |
| | 106 | include/: |
| | 107 | total 8.0K |
| | 108 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Aug 27 12:15 php5 |
| | 109 | drwxr-xr-x 2 patrickgibbs patrickgibbs 4.0K Dec 14 16:30 trac |
| | 110 | |
| | 111 | include/php5: |
| | 112 | total 4.0K |
| | 113 | -rw-r--r-- 1 patrickgibbs patrickgibbs 110 Aug 27 12:15 php.ini |
| | 114 | |
| | 115 | include/trac: |
| | 116 | total 4.0K |
| | 117 | -rw-r--r-- 1 patrickgibbs patrickgibbs 46 Dec 14 18:19 trac.htpasswd |
| | 118 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 119 | }}} |
| | 120 | ==== logs ==== |
| | 121 | Useful logs and log backups here. |
| | 122 | {{{ |
| | 123 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -AlhR logs/ |
| | 124 | logs/: |
| | 125 | total 196K |
| | 126 | -rw-r--r-- 1 root adm 299 Dec 16 15:30 error.log |
| | 127 | -rw-r--r-- 1 root adm 16K Dec 16 04:32 error.log.1 |
| | 128 | -rw-r--r-- 1 root adm 1.6K Dec 8 22:27 error.log.2.gz |
| | 129 | -rw-r--r-- 1 root adm 319 Dec 1 22:13 error.log.3.gz |
| | 130 | -rw-r--r-- 1 root adm 374 Nov 24 17:48 error.log.4.gz |
| | 131 | -rw-r--r-- 1 root adm 3.7K Dec 16 15:30 web.log |
| | 132 | -rw-r--r-- 1 root adm 135K Dec 16 05:49 web.log.1 |
| | 133 | -rw-r--r-- 1 root adm 6.4K Dec 9 04:27 web.log.2.gz |
| | 134 | -rw-r--r-- 1 root adm 3.7K Dec 2 05:29 web.log.3.gz |
| | 135 | -rw-r--r-- 1 root adm 4.5K Nov 25 05:54 web.log.4.gz |
| | 136 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 137 | }}} |
| | 138 | I recently learned this command to use while troubleshooting: |
| | 139 | {{{ |
| | 140 | $ tail -f ~/patrickgibbs.mayfirst.org/logs/error.log |
| | 141 | [Sun Dec 16 06:27:46 2012] [error] [client 98.248.101.207] File does not exist: /home/members/patrick0/sites/patrickgibbs.mayfirst.org/web/favicon.ico |
| | 142 | ^C |
| | 143 | $ |
| | 144 | }}} |
| | 145 | ==== .red ==== |
| | 146 | This has something to do with the Members' Control Panel. I haven't touched anything in here, and it looks like I don't have permissions to anyways. |
| | 147 | {{{ |
| | 148 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ ls -AlhR .red/ |
| | 149 | .red/: |
| | 150 | total 4.0K |
| | 151 | drwxr-xr-x 2 root root 4.0K Dec 14 16:34 apache2 |
| | 152 | |
| | 153 | .red/apache2: |
| | 154 | total 12K |
| | 155 | -rw-r--r-- 1 root root 1.1K Dec 14 16:34 apache.conf |
| | 156 | -rw-r--r-- 1 root root 1.2K Dec 7 12:58 apache.conf~ |
| | 157 | -rw-r--r-- 1 root root 1.1K Dec 14 16:34 apache.conf.bak |
| | 158 | 0 patrickgibbs@marx:/home/members/patrick0/sites/patrickgibbs.mayfirst.org$ |
| | 159 | }}} |
| | 160 | ==== users ==== |
| | 161 | This is like `home` on my laptop -- it has a directory for each user, and when you login you arrive in that directory by default, for me `users/patrickgibbs` is the `~` directory. We already looked inside. |
| | 162 | ==== web ==== |
| | 163 | This is where websites live! On those $5/month cPanel hosts I've used, this directory was called '''`public_html` or `www`'''. This starts out empty. |
| | 164 | |
| | 165 | == future changes to this page == |
| | 166 | * add links to the [wiki:participate] page and the "beginners instructions" page |
| | 167 | * add a section about how to ask questions, or link to an explanatory page if one exists. |
| | 168 | * add more detailed explanation of Members' Control Panel, with screen shots, and responses to questions like "Where is Fantastico?" (or does a page like that already exist?) |