INSTALL docs updated, htaccess.sample more generic

This commit is contained in:
Mikael Nordfeldth 2013-10-05 14:28:41 +02:00
parent eb5097aecb
commit ce37edc1b0
2 changed files with 64 additions and 71 deletions

132
INSTALL
View File

@ -61,16 +61,10 @@ and the URLs are listed here for your convenience.
- DB_DataObject http://pear.php.net/package/DB_DataObject - DB_DataObject http://pear.php.net/package/DB_DataObject
- Validate http://pear.php.net/package/Validate - Validate http://pear.php.net/package/Validate
- OpenID from OpenIDEnabled (not the PEAR version!). We decided - OpenID by Janrain, http://janrain.com/openid-enabled/
to use the openidenabled.com version since it's more widely
implemented, and seems to be better supported.
http://openidenabled.com/php-openid/
- PEAR DB. Although this is an older data access system (new - PEAR DB. Although this is an older data access system (new
packages should probably use PHP DBO), the OpenID libraries packages should use PDO), the OpenID libraries depend on PEAR DB
depend on PEAR DB so we use it here, too. DB_DataObject can or MDB2.
also use PEAR MDB2, which may give you better performance
but won't work with OpenID.
http://pear.php.net/package/DB
- OAuth.php from http://oauth.googlecode.com/svn/code/php/ - OAuth.php from http://oauth.googlecode.com/svn/code/php/
- markdown.php from http://michelf.com/projects/php-markdown/ - markdown.php from http://michelf.com/projects/php-markdown/
- PEAR Mail, for sending out mail notifications - PEAR Mail, for sending out mail notifications
@ -93,25 +87,25 @@ and the URLs are listed here for your convenience.
- HTTP_Request2, a library for making HTTP requests. - HTTP_Request2, a library for making HTTP requests.
- PEAR Net_URL2 is an HTTP_Request2 dependency. - PEAR Net_URL2 is an HTTP_Request2 dependency.
A design goal of StatusNet is that the basic Web functionality should A design goal of GNU Social is that the basic Web functionality should
work on even the most restrictive commercial hosting services. work on even the most restrictive commercial hosting services.
However, additional functionality, such as receiving messages by However, additional functionality, such as receiving messages by XMPP,
Jabber/GTalk, require that you be able to run long-running processes require that you be able to run long-running processes on your account.
on your account. In addition, posting by email or from SMS require In addition, posting by email require that you be able to install a mail
that you be able to install a mail filter in your mail server. filter in your mail server.
Installation Installation
============ ============
Installing the basic StatusNet Web component is relatively easy, Installing the basic GNU Social web component is relatively easy,
especially if you've previously installed PHP/MySQL packages. especially if you've previously installed PHP/MariaDB packages.
1. Unpack the tarball you downloaded on your Web server. Usually a 1. Unpack the tarball you downloaded on your Web server. Usually a
command like this will work: command like this will work:
tar zxf statusnet-1.1.1.tar.gz tar zxf gnusocial-*.tar.gz
...which will make a statusnet-1.1.1 subdirectory in your current ...which will make a gnusocial-x.y.z subdirectory in your current
directory. (If you don't have shell access on your Web server, you directory. (If you don't have shell access on your Web server, you
may have to unpack the tarball on your local computer and FTP the may have to unpack the tarball on your local computer and FTP the
files to the server.) files to the server.)
@ -119,125 +113,123 @@ especially if you've previously installed PHP/MySQL packages.
2. Move the tarball to a directory of your choosing in your Web root 2. Move the tarball to a directory of your choosing in your Web root
directory. Usually something like this will work: directory. Usually something like this will work:
mv statusnet-1.1.1 /var/www/statusnet mv gnusocial-x.y.z /var/www/gnusocial
This will make your StatusNet instance available in the statusnet path of This will often make your GNU Social instance available in the gnusocial
your server, like "http://example.net/statusnet". "microblog" or path of your server, like "http://example.net/gnusocial". "social" or
"statusnet" might also be good path names. If you know how to "blog" might also be good path names. If you know how to configure
configure virtual hosts on your web server, you can try setting up virtual hosts on your web server, you can try setting up
"http://micro.example.net/" or the like. "http://social.example.net/" or the like.
If you have "rewrite" support on your webserver, and you should,
then please enable this in order to make full use of your site. This
will enable "Fancy URL" support, which you can read more about if you
scroll down a bit in this document.
3. Make your target directory writeable by the Web server. 3. Make your target directory writeable by the Web server.
chmod a+w /var/www/statusnet/ chmod a+w /var/www/gnusocial/
On some systems, this will probably work: On some systems, this will probably work:
chgrp www-data /var/www/statusnet/ chgrp www-data /var/www/gnusocial/
chmod g+w /var/www/statusnet/ chmod g+w /var/www/gnusocial/
If your Web server runs as another user besides "www-data", try If your Web server runs as another user besides "www-data", try
that user's default group instead. As a last resort, you can create that user's default group instead. As a last resort, you can create
a new group like "statusnet" and add the Web server's user to the group. a new group like "gnusocial" and add the Web server's user to the group.
4. You should also take this moment to make your avatar, background, and 4. You should also take this moment to make your avatar, background, and
file subdirectories writeable by the Web server. An insecure way to do file subdirectories writeable by the Web server. An insecure way to do
this is: this is:
chmod a+w /var/www/statusnet/avatar chmod a+w /var/www/gnusocial/avatar
chmod a+w /var/www/statusnet/background chmod a+w /var/www/gnusocial/background
chmod a+w /var/www/statusnet/file chmod a+w /var/www/gnusocial/file
You can also make the avatar, background, and file directories You can also make the avatar, background, and file directories
writeable by the Web server group, as noted above. writeable by the Web server group, as noted above.
5. Create a database to hold your microblog data. Something like this 5. Create a database to hold your site data. Something like this
should work: should work:
mysqladmin -u "username" --password="password" create statusnet mysqladmin -u "root" --password="rootpassword" create gnusocial
Note that StatusNet must have its own database; you can't share the Note that GNU Social should have its own database; you should not share
database with another program. You can name it whatever you want, the database with another program. You can name it whatever you want,
though. though.
(If you don't have shell access to your server, you may need to use (If you don't have shell access to your server, you may need to use
a tool like PHPAdmin to create a database. Check your hosting a tool like phpMyAdmin to create a database. Check your hosting
service's documentation for how to create a new MySQL database.) service's documentation for how to create a new MariaDB database.)
6. Create a new database account that StatusNet will use to access the 6. Create a new database account that GNU Social will use to access the
database. If you have shell access, this will probably work from the database. If you have shell access, this will probably work from the
MySQL shell: MariaDB shell:
GRANT ALL on statusnet.* GRANT ALL on gnusocial.*
TO 'statusnetuser'@'localhost' TO 'gnusocial'@'localhost'
IDENTIFIED BY 'statusnetpassword'; IDENTIFIED BY 'agoodpassword';
You should change 'statusnetuser' and 'statusnetpassword' to your preferred new You should change the user identifier 'gnusocial' and 'agoodpassword'
username and password. You may want to test logging in to MySQL as to your preferred new database username and password. You may want to
this new user. test logging in to MariaDB as this new user.
7. In a browser, navigate to the StatusNet install script; something like: 7. In a browser, navigate to the GNU Social install script; something like:
http://yourserver.example.com/statusnet/install.php http://social.example.net/install.php
Enter the database connection information and your site name. The Enter the database connection information and your site name. The
install program will configure your site and install the initial, install program will configure your site and install the initial,
almost-empty database. almost-empty database.
8. You should now be able to navigate to your microblog's main directory 8. You should now be able to navigate to your social site's main directory
and see the "Public Timeline", which will be empty. If not, magic and see the "Public Timeline", which will probably be empty. You can
has happened! You can now register a new user, post some notices, now register new user, post some notices, edit your profile, etc.
edit your profile, etc. However, you may want to wait to do that stuff
if you think you can set up "fancy URLs" (see below), since some
URLs are stored in the database.
Fancy URLs Fancy URLs
---------- ----------
By default, StatusNet will use URLs that include the main PHP program's By default, GNU Social will use URLs that include the main PHP program's
name in them. For example, a user's home profile might be name in them. For example, a user's home profile might be found at:
found at:
http://example.org/statusnet/index.php/statusnet/fred http://example.net/gnusocial/index.php/gnusocial/fred
On certain systems that don't support this kind of syntax, they'll On certain systems that don't support this kind of syntax, they'll
look like this: look like this:
http://example.org/statusnet/index.php?p=statusnet/fred http://example.net/gnusocial/index.php?p=gnusocial/fred
It's possible to configure the software so it looks like this instead: It's possible to configure the software so it looks like this instead:
http://example.org/statusnet/fred http://example.net/gnusocial/fred
These "fancy URLs" are more readable and memorable for users. To use These "fancy URLs" are more readable and memorable for users. To use
fancy URLs, you must either have Apache 2.x with .htaccess enabled and fancy URLs, you must either have Apache 2.x with .htaccess enabled and
mod_rewrite enabled, -OR- know how to configure "url redirection" in mod_rewrite enabled, -OR- know how to configure "url redirection" in
your server. your server (like lighttpd or nginx).
1. Copy the htaccess.sample file to .htaccess in your StatusNet 1. Copy the htaccess.sample file to .htaccess in your StatusNet
directory. Note: if you have control of your server's httpd.conf or directory.
similar configuration files, it can greatly improve performance to
import the .htaccess file into your conf file instead. If you're
not sure how to do it, you may save yourself a lot of headache by
just leaving the .htaccess file.
2. Change the "RewriteBase" in the new .htaccess file to be the URL path 2. Change the "RewriteBase" in the new .htaccess file to be the URL path
to your StatusNet installation on your server. Typically this will to your GNU Social installation on your server. Typically this will
be the path to your StatusNet directory relative to your Web root. be the path to your GNU Social directory relative to your Web root.
If you are installing it in the root directory, leave it as '/'.
3. Add or uncomment or change a line in your config.php file so it says: 3. Add, uncomment or change a line in your config.php file so it says:
$config['site']['fancy'] = true; $config['site']['fancy'] = true;
You should now be able to navigate to a "fancy" URL on your server, You should now be able to navigate to a "fancy" URL on your server,
like: like:
http://example.net/statusnet/main/register http://example.net/gnusocial/main/register
If you changed your HTTP server configuration, you may need to restart If you changed your HTTP server configuration, you may need to restart
the server first. the server first.
If it doesn't work, double-check that AllowOverride for the StatusNet If it doesn't work, double-check that AllowOverride for the GNU Social
directory is 'All' in your Apache configuration file. This is usually directory is 'All' in your Apache configuration file. This is usually
/etc/httpd.conf, /etc/apache/httpd.conf, or (on Debian and Ubuntu) /etc/httpd.conf, /etc/apache/httpd.conf, or (on Debian and Ubuntu)
/etc/apache2/sites-available/default. See the Apache documentation for /etc/apache2/sites-available/default. See the Apache documentation for

View File

@ -7,7 +7,8 @@
# http://example.com/ => / # http://example.com/ => /
# http://example.com/mublog/ => /mublog/ # http://example.com/mublog/ => /mublog/
# #
RewriteBase /mublog/ RewriteBase /
#RewriteBase /mublog/
## Uncomment these if having trouble with API authentication ## Uncomment these if having trouble with API authentication
## when PHP is running in CGI or FastCGI mode. ## when PHP is running in CGI or FastCGI mode.