Thursday, December 13, 2012

Create a Simple Machines Forum (SMF) - Part02


SMF installing check list.

1. Check Client Requirements
2. Check Server Requirements
3. Check Server Recommendations
4. Obtain SMF
5. Upload SMF
6. Run the SMF Installer
7. Using Webinstall

Now you're in the first page of SMF installer from localhost.

STEP 1 :: WELCOME



STEP 2 :: WRITABLE CHECK



to work manually, Some files need to be writable for SMF to work properly. This step allows you to let the installer make them writable for you. However, in some cases it won't work - in that case, please make the following files 777 (writable, 755 on some hosts)

Used user dora in my linux. i will trying to start writable to all data in the list above.

[dora@localhost smf]$ chmod 777 attachments
[dora@localhost smf]$ chmod 777 avatars
[dora@localhost smf]$ chmod 777 cache
[dora@localhost smf]$ chmod 777 Packages
[dora@localhost smf]$ chmod 777 Packages/installed.list
[dora@localhost smf]$ chmod 777 Smileys
[dora@localhost smf]$ chmod 777 Themes
[dora@localhost smf]$ chmod 777 agreement.txt
[dora@localhost smf]$ chmod 777 Settings.php
[dora@localhost smf]$ chmod 777 Settings_bak.php

when you do this steps, as you can see, writable file will be gone from the list. But if you go to smf file in your server, you can see the writable files will be auto highlight in there.



Now you're in the STEP 3 :: DATABASE SETTINGS



FIRST, you must make sure your mysql is ready.
cmd:: [root@localhost ~]# mysql -u root
        mysql> show databases;
        mysql> use mysql;
        >> ERROR 1044 (42000):Access denied for user ''@'localhost' to
           database 'mysql'

*** this is because i got something wrong with my mysql/database.

       [root@localhost ~]# /sbin/service mysqld stop 
       [root@localhost ~]# mysqld_safe --skip-grant-tables &
       [root@localhost ~]# mysql -u root 
         mysql> show databases;
         mysql> use mysql;
         mysql> update user set password=PASSWORD("123456") where  
                User='root';
         mysql> flush privileges;
         mysql> \q

       [root@localhost ~]#  /etc/init.d/mysqld stop
       [root@localhost ~]#  /etc/init.d/mysqld start

then reload my phpadmin. user :: root / pass :: 123456
>> #1045 - Access denied for user 'root'@'localhost'(using password:YES)

*** this is because i still got something wrong with my mysql/database.

        [root@localhost ~]# cat /etc/sysconfig/selinux
        [root@localhost ~]# chkconfig --list |grep restorecond
        [root@localhost ~]#  netstat -tanp |grep 3306
        [root@localhost ~]# mysql -u root -p  
           Enter password :      (password : 123456)
           >> ERROR 1045 (28000):Access denied for user 'root'@'localhost
              '(using password: YES)
        [root@localhost ~]# mysql -u root 
           mysql> show databases;
           mysql> \q

        [root@localhost ~]# mysqladmin -u root password 123456
           >>mysqladmin: Can't turn off logging; error: 'Access denied;
             you need the SUPER privilege for this operation'
        [root@localhost ~]# mysqladmin -u root -p'123456' password 1234
           >>mysqladmin: connect to server at 'localhost' failed
        [root@localhost ~]# mysqladmin -u root -p'123456' password 123456
           >>mysqladmin: connect to server at 'localhost' failed

*** this mean i cant used this mysqld. So i have to delete it and install
    it back one more time.

        [root@localhost ~]# rpm -e mysql-server-5.1.66-1.el6_3.i686
        [root@localhost ~]# rpm -qa |grep mysql-server
        [root@localhost ~]#  ls -l /usr/lib/mysql/

****    yum install mysql-server
        [root@localhost ~]# /sbin/service mysqld start

** the results is still same.

        [root@localhost ~]# yum remove mysql mysql-libs mysql-server

****    yum install  mysql mysql-libs mysql-server  phpmyadmin
        [root@localhost ~]# /sbin/service mysqld start

** when the results still same. mean i still didnt have 'mysqld' in show 
   database mysql.

****    yum install mlocate
        [root@localhost ~]# yum remove mysql mysql-libs mysql-server

        [root@localhost ~]# updated.
        [root@localhost ~]# locate mysql'then the history of mysql appear
        [root@localhost ~]# rm -rf /var/lib/mysql/
        [root@localhost ~]# updatedb
        [root@localhost ~]# locate mysql
        [root@localhost ~]#  rm -rf /var/log/mysql/
        [root@localhost ~]#  rm -rf /var/log/mysql*
        [root@localhost ~]#  rm -f/root/.mysql_history
        [root@localhost ~]# updatedb(now see the different of ls 
                                     files left.)

** just delete the files related.

****    yum install  mysql mysql-libs mysql-server  phpmyadmin
        [root@localhost ~]# /sbin/service mysqld start
        [root@localhost ~]# mysql -u root
           mysql> show databases;
           mysql> \q
         
        [root@localhost ~]# cat /etc/httpd/conf.d/phpmyadmin.conf
           = edit file deny to allow from all.
           = nano -w /usr/share/phpmyadmin/config.inc.php 

                  $cfg['blowfish_secret'] = ''; (fill in the blank)
                  $cfg['blowfish_secret'] = 'airbatucampur';

        [root@localhost ~]# apachectl restart

** When everything seems oke now... go back to shell.

         [root@localhost ~]# su - dora
         [dora@localhost ~]$ pwd
            >> /home/dora
         [dora@localhost ~]$ ls
            >> BNC.docx  public_html  smf_2-0-2_install.tar.bz2   
         [dora@localhost ~]$ cd public_html
            >> /home/dora/public_html
         [dora@localhost public_html]$ rm -rf smf
         [dora@localhost public_html]$ mkdir smf ; cd smf ; tar xjf 
                               /home/dora/smf_2-0-2_install.tar.bz2

** new URL : http://192.168.56.10/public_html/smf/install.php 
** Now focus to STEP 3. Database Settings.
    - Go to phpmyadmin
    - login root no password.
    - MySQL > db > Browse > Insert
      ** host = localhost
      ** smf_db = name_db
      ** user = dora
      ** click YES for the top six option (from select_priv until 
         drop_priv & alter-priv [Y])
      ** save.
    - MySQL > user > Browse > Insert
      ** host = localhost
      ** user = dora
      ** password = '' (my password)
         noted : in the back choose 'choose password'
      ** save.
    - click HOME.
    - database name :: smf_db -> create.
    - click Reload privileges. "The privileges were reloaded suc.

    - in SMF database settings.
    - fill in the blank.
    - username :: dora
    - database name :: smf_db
    - table prefix :: smf_ <- let it be.
    - server :: localhost 
** NOTED (in addition)
checking for mysql/httpd
     
     cmd::
     [root@localhost ~]# chkconfig --list |grep mysql
     >> mysqld  0:off 1:off 2:off 3:off 4:off 5:off 6:off

     = it's mean your mysqld wont start in boot time.
       changed it to autostart on boot.

     [root@localhost ~]# chkconfig mysqld on
     [root@localhost ~]# chkconfig --list |grep mysql
     >> mysqld  0:off 1:off 2:on 3:on 4:on 5:on 6:off

     [root@localhost ~]# chkconfig --list |grep httpd
     >> httpd  0:off 1:off 2:on 3:on 4:on 5:on 6:off

     = httpd already auto on while boot.

STEP 4 :: FORUM SETTINGS



STEP 5 :: DATABASE POPULATION



STEP 6 :: ADMIN ACCOUNT



STEP 7 :: FINALIZE INSTALL



** it's done for now. :)

Create a Simple Machines Forum (SMF) - Part01

This is the first asignment from my ankel. :)

1. download smf_2-0-2_install to lappy.
2. compress the file to smf_2-0-2_install.tar.bz2.
3. copy smf_2-0-2_install.tar.bz2 to server
  • 3.1 open vbox
  • 3.2 copy smf_2-0-2_install.tar.bz2 to server cmd ::scp smf_2-0-2_install tar.bz2 dora@192.168.56.10:/home/dora
  • 3.3 check back :: ssh dora@server ls >> [dora@localhost ~]$ ls smf_2-0-2_install.tar.bz
  • 3.4 now make a new directory cmd :: mkdir -p public_html/smf check back :: ls public_html smf_2-0-2_install.tar.bz2
  • 3.5 cmd :: cp smf_2-0-2_install.tar.bz2 public_html/smf
  • 3.6 cd public_html/smf [dora@localhost smf]$ ls smf_2-0-2_install.tar.bz2
  • 4. compress the file.
       cmd :: tar xjf smf_2-0-2_install.tar.bz2
    

    Packages Sources  cache  install_2-0_sqlite.sql ssi_examples.php       SSI.php  Themes   index.php  license.txt  ssi_examples.shtml           Settings.php      agreement.txt  install.php  news_readme.html         subscriptions.php Settings_bak.php  attachments  install_2-0_mysql.sql readme.html       Smileys     avatars      install_2-0_postgresql.sql  smf_2-0-2_install.tar.bz2 

    5. After extract the file like the box above show,
       use this cmd once for a user :: chmod 711 $HOME
       noted : must do it again only to another user.

    6. Now back to root .
       su -
       cd /var/www/html then pwd
       ln -s /home/dora/public_html public_html <- link the file
       ls -1
       exit 
    7. Open my safari :http://server/public_html/smf/install.php

    Now i can see SMF page is ready to setting up from my localhost. :)

    Quick Command U must always Remember.

    To begin playing with your CentOS6 or Terminal, you need to remember all the simple-simple commands that you will always used to code. As oldest always said "Practise make Perfect", it's actually no doubt. You must remember all the commands or else you will loose ur track or lost in what you are doing later.

    This is all the commands that i have used ::

    1. THE NOTED ::
    1. /etc/hosts (for pc internet connection) 
    2. postfix (e-mail connection touch)
    3. varchar - variable character
    4. console/konsole/terminal/shell/exterm (same term)
    5. in my localhost :: 'dora' is my shell user
    6. centOS save energy (click mouse in blank then press spacebar)
    7. Vbox have snapshot to restore the last backup system.
    8. sudo < used in MAC terminal. no function but some system 
       direct edit w/o sudo is not allowed 
    9. Print skrin on MAC : control-shift-4, click SPACEBAR to kamera
       icon and clikc ENTER.
    10.Cant put any active web in /root .
    11.cmd IRC :: /ctcp [nick] version
    

    2. TERMINAL COMMAND ::
    1. ping ( to test IP)
    2. ping -c 4
    3. ls 'this command to see files ls . depend on directory.
    4. cd 'this command used to go into files.
    5. scp [filename] dora@192.168.56.10:/home/dora 'cmd to transfer file to server.
    6. pwd (print work directory) 'command use to see directory.
    7. mkdir [filename] 'create new folder
    8. scp dora@192.168.56.10:/home/dora/BNC* . 'or
    9. scp dora@192.168.56.10:/home/dora/BNC.docx . 'cmd to take file from server.
    10./exec -o df -h |grep home
    11.w
    12.check safari :: safari & / whereis safari

    3. USED WHILE BUILD UP LOCALHOST (server) ::

    1. ls /etc/sysconfig
    2. ls /etc/sysconfig/network-scripts
    3. cat /etc/sysconfig/network-scripts/ifcfg-eth0
    4. dhclient eth0
    5. ifconfig eth0
    6. ifconfig eth1
    7. ifconfig (see how much we have eth) 
    8. ifconfig |grep inet ' grep = choose.
    9. ifconfig -a |grep inet
    10.dmesg |grep eth (check all eth)
    11.ifconfig eth1 up :: using nano - /sbin/ifconfig eth1 up (permanent up)
    12./sbin/ifconfig eth1 192.168.56.10 netmask 255.255.255.0 broadcast 
       192.168.56.255    (set mask ip for localhost)


    4. SETTING UP PHP/MYSQLD/APACHE:: from terminal and root
    1. rpm -qa (look for ls download)
    2. rpm -qa |grep php (look for ls php that have been dl)
    3. cd /var/www/html
    4. cat info.php
    5. yum install wget
    6. rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-r elease-0.5.2-7. el6.rf.i686.rpm
    7. yum install phpmyadmin
    8. /sbin/service mysqld start
    9. /sbin/service httpd start
    10.apachectl reload
    11.apachectl restart
    12.chkconfig --list |grep mysql
    13.chkconfig mysqld on 14.chkconfig --list |grep httpd


    5. ROOT :: ROOT/USER
    1. ssh (to connect to server) 
       ex :: ssh root@server / ssh dora@server
    2. su - (change/switch user to root)

    6. SERVER COMMAND
    1. rm -f ( delete file/folder )< this cmd should use with careful
    2. adduser [name] 'this is command to adduser in linux.
    3. passwd [user] 
    4. userdel [name] 'this is command to delete user.
    5. yum install 
    6. mv = rename folder
       ex :: mv [oldfoldername] [newfoldername]
    7. tar cjf [folder/filename.tar.bz2] [folder/filename] <- compress
    8. tar xjf [folder/file name] <- decompress
    9. mkdir -p public_html/smf <= make new directory
    10.ls -l (to see what you have install)
    11.ls -s 
    12.uname -an <- will show the system you're in.


    7. NANO EDITOR

    noted :: when you used nano for editing, enter new line from the last command line to type your new command then reboot.
    1. nano test (test nano)
    2. cntl x :: to save
    3. cntl r :: editing
    4. cat test 
    5. nano -w /etc/rc.local (set ip)
    6. nano -w /etc/sysconfig/selinux 'changed.
       SELINUX=enforcing => SELINUX=disabled
    7. nano -w /etc/httpd/conf.d/phpmyadmin.conf7. 
       Deny from all > Allow from all
    8. nano -w /usr/share/phpmyadmin/config.inc.php
       $cfg['blowfish_secret'] = ''; (fill in the blank)
       ex :: $cfg['blowfish_secret'] = 'airbatucampur';
    9. nano -w /etc/my.cnf
    10.sudo nano -w /etc/resolv.conf (terminal) 'for dns 

    8. FILES BACKUP (on system)
    cmd::
    1. cd VirtualBox\ VMs/
    2. /VirtualBox VMs$ tar cjf CentOS6-`date '+%d-%B-%Y'`.tar.bz2 CentOS6/
    3. /VirtualBox VMs$ ls |grep bz2
       ... to check folder size.
    4. /VirtualBox VMs$ du -ms CentOS6-23-November-2012.tar.bz2
    5. /VirtualBox VMs$ du -ms CentOS6 

    9. CHANGE IP TO OTHER WORD ex:server|vbox|centOS|urname
    noted : do in MAC.
    
    1. cat /etc/hosts
    2. sudo nano /etc/hosts
    3. last line add like this :: 192.168.56.10   server
    4. save . cntrl x 

    10. CHANGE DIRECTORY FOLDER NAME ON SERVER
    1. login user << in centOS
       [dora@localhost ~]$ pwd
    2. su - [go to root]
       [root@localhost dora]# pwd
       /home/dora
    3. cd /var/www/html
    4. ls -l 'to locate location.
    5. ln -s /home/dora/public_html/ www
    
    *** with the two cmd above, no. 9 and 10, my URL will be like this:
        http://server/www/newproject.. . 


    noted :: command will be update when new command is used. :)

    How to start using code.


    What i have here :: Mac Terminal / VirtualBox with centOS 06


    details ....

    MacbookPro (Software Mac OS X Lion 10.7.5 )


    Oracle VM VirtualBox setting with ..

    1. General - Name :: Centos06 - Operating System :: Red Hat

    2. System - Base Memory :: 1024MB - Boot Order ::Floppy,CD/DVD-ROM,Hard Disk :: Acceleration :: VT-x/AMD-V,Nested Paging,PAE/NX

    3. Display - Video Memory :: 12MB - Remote Desktop Server :: Disabled.

    4. Storage - Controller : IDE/IDE Secondary Master :: [CD/DVD]Host Drive 'MATSHITA DVD-R UJ-8A8' - Controller : SATA/SATA Port 0 :: CentOS6.vdi (Normal, 8.00 GB)

    5. Audio - Host Driver :: CoreAudio - Controller :: ICH AC97

    6. Network - Adapter 1 :: Intel PRO/1000 MT Dekstop (NAT) - Adapter 2 :: Paravirtualized Network (Host-Only Adaper, 'vboxnet0')

    7. USB - Device Filters :: 0 (0 active)

    8. Shared - None

    9. Description - None

    noted :: This is the first things to set out. :)

    i have set my own localhost :: 192.168.56.10 and changed it with name 'server' , maybe later i will change it to name 'mydora' . :)

    what is that mean .? mean .. i can root my centOS from Mac terminal by only typing 'server' . It's no need to type the IP all the time.. it is easy right .? and looks more smooth for the url . ex http://server/blabla or http://mydora/blabla.

    And i have already installed nano, nano is the unix editor. yum install for phpmyadmin(editor for database interface), wget installed before installed phpmyadmin. Why must installed wget first .?? because phpmyadmin is not in standard repo. I have to installed repoforge first mean i have to install phpmyadmin from another server.