Ask Fedora SOP

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(no need to manually update skin media revision anymore)
(update)
Line 60: Line 60:
 
   # yum install askbot
 
   # yum install askbot
  
Run the following command and answer the questions asked
+
The /etc/askbot/sites/ask/conf/settings.py file should look something like:  
<pre>
+
# su - askfedora
+
$ cd /srv
+
$ askbot-setup
+
 
+
  Deploying Askbot - Django Q&A forum application
+
  Problems installing? -> please email admin@askbot.org
+
 
+
  To CANCEL - hit Ctr-C at any time
+
  Where to deploy (in which directory)? askfedora
+
 
+
  Adding new directories:
+
  /srv <-/askfedora
+
  Accept? (type yes/no): yes
+
 
+
  Copying files:
+
  * __init__.py
+
  * settings.py  
+
  * manage.py
+
  * urls.py
+
 
+
  copying directories:  * doc
+
  * cron
+
  * upfiles
+
 
+
  Done. Please find further instructions in the file below:
+
  /usr/lib/python2.6/site-packages/askbot/doc/INSTALL
+
 
+
$
+
$ cd askfedora
+
$ vim settings.py
+
  
 
   DATABASE_ENGINE = 'postgresql_psycopg2'
 
   DATABASE_ENGINE = 'postgresql_psycopg2'
Line 111: Line 80:
 
   #
 
   #
 
   # ASKBOT_CUSTOM_AUTH_MODULE = 'authfas'
 
   # ASKBOT_CUSTOM_AUTH_MODULE = 'authfas'
 
$
 
$ python manage.py syncdb
 
$ python manage.py migrate
 
 
# chkconfig postgresql on
 
# service postgresql start
 
 
</pre>
 
</pre>
  
Now, we have Askbot forum set up and configured, but still not ready to go. We need to configure Apache, and Postfix mail server to server web pages and send emails as and when required.
 
 
== Postfix ==
 
 
The Postfix website has a good documentation about configuring a stand-alone mail server.
 
 
see -> [http://www.postfix.org/STANDARD_CONFIGURATION_README.html http://www.postfix.org/STANDARD_CONFIGURATION_README.html]
 
 
We need to set following variables in /etc/postfix/main.cf file.
 
<pre>
 
# postconf -n
 
  alias_maps = hash:/etc/aliases
 
  alias_database = hash:/etc/aliases
 
 
  command_directory = /usr/sbin
 
  config_directory = /etc/postfix
 
  daemon_directory = /usr/libexec/postfix
 
 
  debug_peer_level = 2
 
  default_privs = nobody
 
  header_checks = regexp:/etc/postfix/header_checks
 
 
  html_directory = no
 
  inet_interfaces = all
 
  mail_owner = postfix
 
  mailbox_command = /usr/bin/procmail
 
  mailq_path = /usr/bin/mailq.postfix
 
 
  manpage_directory = /usr/share/man
 
  masquerade_domains = redhat.com
 
  masquerade_exceptions = root apache
 
 
  mydomain = dev.fedoraproject.org
 
  myorigin = $mydomain
 
  myhostname = ask01.dev.fedoraproject.org
 
  mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
 
 
  newaliases_path = /usr/bin/newaliases.postfix
 
  queue_directory = /var/spool/postfix
 
  readme_directory = /usr/share/doc/postfix-2.4.5/README_FILES
 
  recipient_delimiter = +
 
  relayhost =
 
 
  sample_directory = /usr/share/doc/postfix-2.4.5/samples
 
  sendmail_path = /usr/sbin/sendmail.postfix
 
  setgid_group = postdrop
 
  unknown_local_recipient_reject_code = 550
 
 
# chkconfig postfix on
 
# service postfix start
 
</pre>
 
 
== Apache ==
 
 
Askbot and Django-Project, both have good documentation for deploying a Django project with Apache and python_modwsgi on a Linux machine.
 
 
  -> [http://askbot.org/doc/deployment.html http://askbot.org/doc/deployment.html]
 
  -> [https://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/ https://docs.djangoproject.com/en/dev/howto/deployment/modwsgi]
 
 
We need to add following snippets to /etc/httpd/conf/httpd.conf file.
 
 
<pre>
 
# yum install mod_wsgi
 
 
# vi /etc/httpd/conf/httpd.conf
 
  #
 
  # Python WSGI
 
  #
 
  Alias /m/  /usr/lib/python2.6/site-packages/askbot/skins/
 
  Alias /upfiles/ /srv/askfedora/askbot/upfiles/
 
  Alias /admin/media/ /usr/lib/python2.6/site-packages/django/contrib/admin/media/
 
  <Directory /usr/lib/python2.6/site-packages/askbot/skins>
 
      Order deny,allow
 
      Allow from all
 
  </Directory>
 
 
  <Directory /srv/askfedora/askbot/upfiles>
 
      Order deny,allow
 
      Allow from all
 
  </Directory>
 
 
  WSGIScriptAlias /  /srv/askfedora/apache/askfedora.wsgi
 
  <Directory /srv/askfedora>
 
    Order deny,allow
 
    Allow from all
 
  </Directory>
 
 
# vi /srv/askfedora/apache/askfedora.wsgi
 
 
  #!/usr/bin/python
 
 
  import os
 
  import sys
 
 
  p = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
  p = os.path.dirname(p)
 
  if (p not in sys.path):
 
      sys.path.append(p)
 
 
  os.environ['DJANGO_SETTINGS_MODULE'] = 'askfedora.settings'
 
 
  import django.core.handlers.wsgi
 
  application = django.core.handlers.wsgi.WSGIHandler()
 
 
Make sure the askfedora.wsgi file has appropriate permissions, so that apache user can read it.
 
 
# chkconfig httpd on
 
# service httpd start
 
</pre>
 
  
 
Now askfedora website should be accessible from the browser.
 
Now askfedora website should be accessible from the browser.

Revision as of 18:27, 14 September 2011

Infrastructure InfrastructureTeamN1.png
Shortcut:
ISOP:ASKFEDORA
Note.png
This is a draft

To set up http://ask.fedoraproject.org (not active yet) based on Askbot as a question and answer support forum for the Fedora community. A test instance could be seen at http://ask01.dev.fedoraproject.org.

This page describes how to set up and customize it from scratch.

Contents

Contact Information

Owner: Fedora Infrastructure Team

Contact: #fedora-admin

Persons: mether pjp

Sponsor: nirik

Location:

Servers:

Purpose: To host Ask Fedora

Creating database

# yum install postgresql postgresql-server

# su - postgres

$ cd /var/lib/pgsql/data

$ initdb $PWD

$ exit

# service postgresql start

# psql -U postgres

postgres# create user askfedora with password 'xxx';

postgres# create database askfedora;

postgres# ALTER DATABASE askbot owner to askbot;

postgres# \q;

# psql -U askbot -W askbot

askbot=>

Setting up the forum

Askbot is packaged and available in Rawhide, Fedora 16 and EPEL 6. On a RHEL 6 system, you need to install EPEL 6 repo first.

 # yum install askbot

The /etc/askbot/sites/ask/conf/settings.py file should look something like:

 DATABASE_ENGINE = 'postgresql_psycopg2'
 DATABASE_NAME = 'testaskbot'
 DATABASE_USER = 'askbot'
 DATABASE_PASSWORD = 'xxxxx'
 DATABASE_HOST = '127.0.0.1'
 DATABASE_PORT = '5432'
 # Outgoing mail server settings
 #
 DEFAULT_FROM_EMAIL = 'askfedora@fedoraproject.org'
 EMAIL_SUBJECT_PREFIX = '[Askfedora]'
 EMAIL_HOST='127.0.0.1'
 EMAIL_PORT='25'
 # This variable points to the Askbot plugin which will be used for user
 # authentication.  Not enabled yet because we don't need FAS auth but use Fedora id as a openid provider. 
 #
 # ASKBOT_CUSTOM_AUTH_MODULE = 'authfas'

</pre>


Now askfedora website should be accessible from the browser.

Adding administrators

As of Askbot version 0.7.21, the first user who logs in automatically becomes the administrator. In previous versions, you have to do the following.

 # cd /srv/askfedora/
 # python manage.py add_admin 1
   Do you really wish to make user (id=1, name=pjp) a site administrator? yes/no: yes

Once a user is marked as a administrator, he or she can go into anyone's profile, go the "moderation" tab in the end and mark them as administrator or moderator as well as block or suspend a user.

Change settings within the forum

  • Data entry and display:

Disable "Allow asking questions anonymously" Enable "Force lowercase the tags" Change "Format of tag list" to "cloud" Change "Minimum length of search term for Ajax search" to "3" Change "Number of questions to list by default" to "50" Change "What should "unanswered question" mean?" to "Question has no answers"

  • Email and email alert settings

Change "Default news notification frequency" to "Instantly"

  • Flatpages - about, privacy policy, etc.

Change "Text of the Q&A forum About page (html format)" to the following

Ask Fedora provides a community edited knowledge base and support forum for the Fedora community. Make sure you read the FAQ and search for existing answers before asking yours. If you want to provide feedback, just a question in this site! Tag your questions "meta" so that the feedback is highlighted to the administrators of Ask Fedora.

  • Q&A forum website parameters and urls

Change "Site title for the Q&A forum" to "Ask Fedora: Community Knowledge Base and Support Forum"

Change "Comma separated list of Q&A site keywords" to "Ask Fedora, forum, community, support, help"

Change "Copyright message to show in the footer" to "All content is under Creative Commons Attribution Share Alike License. Ask Fedora is community maintained and Red Hat or Fedora Project is not responsible for content"

Change "Site description for the search engines" to "Ask Fedora: Community Knowledge Base and Support Forum"

Change "Short name for your Q&A forum" to "Ask Fedora"

Change "Base URL for your Q&A forum, must start with http or https" to "http://ask.fedoraproject.org"

  • Sidebar widget settings - main page

Disable "Show avatar block in sidebar"

Disable "Show tag selector in sidebar"

  • Skin and User Interface settings

Upload "Q&A site logo"

Upload "Site favicon". Must be a ICO format file because that is the only one IE supports as a fav icon .

Enable "Apply custom style sheet (CSS)"

Upload the following custom CSS

#ab-main-nav a {
color: #333333;
background-color: #d8dfeb;
border: 1px solid #888888;
border-bottom: none;
padding: 0px 12px 3px 12px;
height: 25px;
line-height: 30px;
margin-right: 10px;
font-size: 18px;
font-weight: 100;
text-decoration: none;
display: block;
float: left;
}

#ab-main-nav a.on {
height: 24px;
line-height: 28px;
border-bottom: 1px solid #0a57a4;
border-right: 1px solid #0a57a4;
border-top: 1px solid #0a57a4;
border-left: 1px solid #0a57a4; /*background:#A31E39; */
background: #0a57a4;
color: #FFF;
font-weight: 800;
text-decoration: none
}

#ab-main-nav a.special {
font-size: 18px;
color: #072b61;
font-weight: bold;
text-decoration: none;
}

/* tabs stuff */
.tabsA { float: right; }
.tabsC { float: left; }
 
.tabsA a.on, .tabsC a.on, .tabsA a:hover, .tabsC a:hover {
background: #fff;
color: #072b61;
border-top: 1px solid #babdb6;
border-left: 1px solid #babdb6;
border-right: 1px solid #888a85;
border-bottom: 1px solid #888a85;
height: 24px;
line-height: 26px;
margin-top: 3px;
}
 
.tabsA a.rev.on, tabsA a.rev.on:hover {
padding: 0px 2px 0px 7px;
}
 
.tabsA a, .tabsC a{
background: #f9f7eb;
border-top: 1px solid #eeeeec;
border-left: 1px solid #eeeeec;
border-right: 1px solid #a9aca5;
border-bottom: 1px solid #888a85;
color: #888a85;
display: block;
float: left;
height: 20px;
line-height: 22px;
margin: 5px 0 0 4px;
padding: 0 7px;
text-decoration: none;
}
 
.tabsA .label, .tabsC .label {
float: left;
font-weight: bold;
color: #777;
margin: 8px 0 0 0px;
}
 
.tabsB a {
background: #eee;
border: 1px solid #eee;
color: #777;
display: block;
float: left;
height: 22px;
line-height: 28px;
margin: 5px 0px 0 4px;
padding: 0 11px 0 11px;
text-decoration: none;
}

a {
color: #072b61;
text-decoration: none;
cursor: pointer;
}

div.side-box
{
width:200px;
padding:10px;
border:3px solid #CCCCCC;
margin:0px;
background: -moz-linear-gradient(top, #DDDDDD, #FFFFFF);
}

Debugging

Set DEBUG to True in settings.py file and restart Apache.