Monday, April 2, 2012

Moodle: Failed write to disk problem

"Failed to write file to disk"


I've been experience the same problem in wordpress before. 
It was caused by temp folder full. So user failed to upload any files to the system.


Solution:
  1. Check your temp folder in moodle
    Eg: /mnt/data/moodle/moodledata/temp/backup/
  2. Delete the temp content inside this folder
  3. Try upload file to system
  4. Upload function should be ok by now.
Good luck!


Friday, March 2, 2012

Drupal7.x: Views - Create Icon link views

It quite complicated to understand view features in Drupal 7.x.
I have been trying to create views for icon with menu links two times but failed.
Today, I tried again and finally successful to create one. Hooreyyy!

How to create views?
  1. Structure  >  Views
  2. Add New View  >  Title: Links > Add Blocks  >  Save
  3. Format: HTML list
  4. Show: Fields
  5. In FIELDS settings:
    add:
    Content: URL  >  Exclude From Display
    Content: صورة >  SHOWREWRITE RESULTS >  Output this field as a link  > Link path : [field_url]
    *Check the available token format from  SHOWREPLACEMENT PATTERNS - [field_url] == Content: URL
    - [field_image] == Content: صورة

    Content: Title > 
    SHOW
    REWRITE RESULTS >  Output this field as a link  > Link path : [field_url]
    *Check the available token format from  SHOWREPLACEMENT PATTERNS - [field_url] == Content: URL
  6. Apply (All displays) after each settings
  7. Save the views

How to display view in block?
  1. Structure  >  Blocks
  2. Find  View: Links  >  Set Block Region: Sidebar first
  3. Save.
  4. Configure  View: Links 
  5. Set Block Title:  Student Portal Services
  6. Pages > All pages except those listed
    front
    main
    welcome
  7. Languages: Translatable, Not restricted
  8. Save block
  9. Translate  >  Choose Arabic  >  translate
  10. Set Arabic Title:  الخدمات لبوابة الطالب
  11. Save translation
  12. Save block
  13. See the changes in other page than page.
    The block for Student Portal Services will appear, accordingly to your current chosen language.

Drupal: Multilingual- Translate Home Link Setting

About one week we try to translate Home link , but still have issue that both language appear together in main menu navigation. But today we just got idea to create the home link from the main page, insteed of using default front page setting.

How to do?
  1. Disable Home in main menu list link.
  2. Go to main page, let say page name: main  (in  URL path settings )
  3. Edit the page
  4. Go to English first  > Menu Settings  > Thick Provide a menu link
  5. Set  Menu link title: Home    and   Save.
  6. Go to Translate to Arabic page   >  Edit for Arabic language
  7. Menu Settings  > Thick Provide a menu link
  8. Set  Menu link title: الرئيسية   and   Save.
  9. Make sure URL path settings  > Set   Alias: welcome
  10. Refresh the site and check back the main menu navigation.
  11. The new Home menu will appear accordingly to your chosen language.
How to arrange Home menu to be the first in list?
  1. Go to Structure  >  Menus  >  Main Menu   >  List links
  2. You can arrange the weight or drag the link based on me menus priority rank.
  3. Thats it!
Good Luck.

Sunday, February 26, 2012

SSH Connection Failed: AWS Cloud Access failed after switch IP

My Case:

Server OS: FreeBSD 8.x
After switching IPs between 2 application, the new server can be ssh, but the previous one failed.
New : x.x.x.143
Old : x.x.x.250

SSH Access command to new server ok, but the old one failed.
I ask my bos, and luckily it not because of wrong configured, but the access cache that stored in host..

  1. Run this command:
    % ee .ssh/known_hosts

    This file keep cache of previous access ssh command
  2. Delete all the content
  3. Save
  4. Try run the ssh command again:
    %ssh -i cloudcert.pem os@x.x.x.250
  5. Connection success!.

MySQL Server: Can’t connect to local MySQL server through socket /tmp/mysql.sock

Server OS: FreeBSD 8.x

This mysql server cannot start mysql server service after shutting down.
Try to start manually using this command, but still got error.#/usr/local/etc/rc.d/mysql-server start

Step taken:

1) Check Error Log for mysql(in mysqldata/mysql/)
    # ee ----------------mysql.err
  
    ERROR start from this line:
    
120224 19:42:32 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-locking'

2) Try to find where the rules  '--skip-locking' stated

3) This rule stated in my.cnf located in mysql path
    # ee my.cnf

4) Comment the line like this
:    
port            = 3306
socket          = /tmp/mysql.sock
#skip-locking
key_buffer = 256M
:
:

5) Start the Mysql-Server command
    #/usr/local/etc/rc.d/mysql-server start

6) Check from some related command
    #ps ax     or
    #sockstat -4
    #top

7) Check in mysql path (mysqldata/mysql), pid file will auto created.
    -rw-rw----  1 mysql  mysql         6 Feb 27 10:36 thedomain.mysql-name-server.pid


FreeBSD Server: Change date

How to change server date in FreeBSD?

1) Check current server date
#date

2)Update correct date refering asia
#ntpdate asia.pool.ntp.org

3)Check again current date after update
#date

.

Monday, December 19, 2011

Wordpress - Permalink Problem

Salam,

I've just set up WordPress on my personal FreeBSD server, and now I'm trying to configure permalinks to this format:
/%category%/%postname%

This is not working. I've followed those instructions as well as I can, but it's still not working.

In httpd.conf:


Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


Then,I chmod'ed the .htaccess-file so WordPress could edit the file. The file is now containing this:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress

After some reading and checking, I found out that my .htaccess-file is not being read! How to solve this?

From forum I read, he says that "You see AllowOverride None anywhere in your config files?"

So in my httpd.conf, I found it here:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
# AllowOverride None
AllowOverride All

I comment the original setting, and set to AllowOverride All.
After restart apache, the permalinks now working like a charm.
Alhamdulillah..

.