Tuesday, June 26, 2018

cleargov q2a question to answer

http://localhost:10/cleargov1/
hoogw
hoogw2000

pass: aaaa1111



=======================
cleargov1

hoogw, hoogw2000, hoogw2001
pass: aaaa1111


-----------------------------
glassgov1:

hoogw
pass: A1a18113






---------------------------------------------------

home page set to 'question'

qa-config add code:

 /*
         *  this make home page as qa=questions  ( with tab recent, most viewed, most voted )
         *  without this, qa=Q&A welcome page.
         */
     
        $QA_CONST_PATH_MAP=array(
                                    'questions' => '',
                                    );
     









***************************

不容许注册
cleargov
click admin --- click user -------------  check tempary suspense new user registration 



glassov
mysql Db, configure table ----------— close registration ----------— true


***************************



=============================

click top navigation bar ,  'admin'

left side panel, click 'page'

turn on/off  'ask a question' === '' create a topic'




-----------------------------------

++++ change  bottom info+++++++

C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-main.php

'suggest_ask' => 'All Data Are Location Based - TransparentGov.net - huguowen@gmail.com 310-710-6501',

'voted_qs_in_x' => 'Most voted in ^',
'voted_qs_title' => 'Most voted ',






------------------- remove  footer, admin setting can do but not good-------------------

C:\Apache24\htdocs\cleargov1\qa-include\app\page.php


/*
'footer' => array(
'feedback' => array(
'url' => qa_path_html('feedback'),
'label' => qa_lang_html('main/nav_feedback'),
),
),
                     *
                     */





C:\Apache24\htdocs\cleargov1\qa-include\qa-theme-base.php

 /*
$this->nav('footer');
$this->attribution();
$this->footer_clear();
                 *
                 */



 ---------End  ------------------- remove  footer, admin setting can do but not good-------------------




-------------hide header top banner ------ no need comment, admin setting can hide header top banner  ---------------

C:\Apache24\htdocs\cleargov1\qa-theme\Donut-theme\qa-donut-layer.php

/*
         
            if ( $this->is_home() && qa_opt( 'donut_show_home_page_banner' ) ) {
                //check if user closed the header intentionally
                $user_hidden = qa_opt( 'donut_banner_closable' ) ?
                        @$_COOKIE['donut_hide_site_header'] : 'no';
                     
                if ( $user_hidden !== 'yes' )
                 
                    donut_include_template( 'site-header.php', $this );
            }
             *
             *
             */
--------------End ------- no need comment, admin setting can hide header top banner  ---------------------





===========  white background =================
C:\Apache24\htdocs\cleargov1\qa-theme\Donut-theme\css\donut.css


/*
  background: #f3f3f3;
  background-image: url("../images/asanoha-bg.png");
  background-repeat: repeat;
  */

========== End ====  white background =================






----- 'question'  either hide or replace with something else ------

C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-main.php


'nav_qa' => 'T&A',
'nav_qs' => 'Topic',

question 如果能省掉,就省掉,如果不能,就topic 取代

Recent questions  ----  Recent
Hot questions  --- Hot



C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-question.php

'add_q_favorites' => 'Add this to my favorites',

-----End ------   'question'  either hide or replace with something else ------




*********** on list page, remove "0 answered" next to "1 voted" *************
C:\Apache24\htdocs\cleargov1\qa-theme\Donut-theme\qa-donut-layer.php


comment out this line
  //  $this->a_count( $q_item );
****** End ***** on list page, remove "0 answered" next to "1 voted" *************


=====================
 asked  make empty
C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-main.php
'asked' => '',
===============


===========================
C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-profile.php
question change to topic
===================



============================================================
remove --- (240 points) --- at list page,  jun, 23 by hoogw2000 ( 240 points)

C:\Apache24\htdocs\cleargov1\qa-include\qa-theme-base.php

comment out:

/*
if (isset($post['who']['points'])) {
$post['who']['points']['prefix'] = '(' . $post['who']['points']['prefix'];
$post['who']['points']['suffix'] .= ')';
$this->output_split($post['who']['points'], $class . '-who-points');
}
                         *
                         */

=======================



=================
remove bottom footer
comment out

C:\Apache24\htdocs\cleargov1\qa-theme\Donut-theme\qa-donut-layer.php

/*
         
            if ( qa_opt( 'donut_show_site_stats_above_footer' ) ) {
                $this->donut_site_stats_bottom();
            }

            $this->output( '














' );


            if ( qa_opt( 'donut_enable_back_to_top_btn' ) ) {
                $this->output( '' );
            }

            $this->output( '
' );

            parent::footer();
            $this->output( '
' );            $this->output( '
', '' );             *
             */


=========================





------------------------------------------
remove tab, hot, most answered

comment out below

C:\Apache24\htdocs\cleargov1\qa-include\app\q-list.php

/*
'hot' => array(
'label' => qa_lang('main/nav_hot'),
'url' => qa_path_html($request, array('sort' => 'hot')),
),
         */


/*
'answers' => array(
'label' => qa_lang('main/nav_most_answers'),
'url' => qa_path_html($request, array('sort' => 'answers')),
),

            */

--------------------------------------------------------------------------------------------





.....................................
C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-misc.php

'nav_user_qs' => 'All topic',

................................................................................




++++++++++++++

C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-question.php

'answer_must_confirm' => 'Please ^5confirm your email address^6 ',
'answer_must_login' => 'Please ^1log in^2 or ^3register^4 ',

'answer_q_popup' => 'Answer',

'ask_button' => 'Post Topic',

'q_notify_email' => 'Email me at this address if my topic is commented on:',

+++++++++++++++++




---------------------------



"Ask a Question"    change to "Create a Topic"

C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-main.php
'nav_ask' => 'Create a Topic',

C:\Apache24\htdocs\cleargov1\qa-include\lang\qa-lang-question.php
'ask_title' => 'Create a topic',
'ask_must_be_approved' => 'Your account must be approved before you create a topic. Please wait or ^1add more information^2.',
'ask_must_confirm' => 'Please ^5confirm your email address^6 to create a topic.',
'ask_must_login' => 'Please ^1log in^2 or ^3register^4 to create a topic.',



search To see more

'suggest_category_qs' => 'To see more, click for all the ^1topic in this category^2. 310-710-6501 huguowen@gmail.com',
'suggest_qs' => 'To see more, click for the ^1full list of topic^2.  310-710-6501 huguowen@gmail.com',
'suggest_qs_tags' => 'To see more, click for the ^1full list of topic^2 or ^3popular tags^4.   310-710-6501 huguowen@gmail.com',_________________________________________________________________________







Friday, June 15, 2018

centos php




run node:
cd /home/hoogw2000/public_html/arcgis_viewer/pm2 start npm -- start


kill node:http://pm2.keymetrics.io
pm2 delete 0
pm2 stop 0
pm2 list
//  //    nohup nodemon --exec npm start





************* user (hoogw) cd /../.../ permission denied   ***********************

putty login (only as hoogw, it is server account) NOT hoogw2000, it is cpannel account,use to login to cpannel
whoami  [show currently what user]
ls, permission denied, try sudo ls
switch user to hoogw2000: sudo su - hoogw2000
if get permission denied, try run as root(super user mode): sudo su        cd /.../...... if run as hoogw2000, you should be able to : cd /home/hoogw2000/public_html/arcgis_viewer/ pm2 start npm -- start ======================================================== Install nodejs, npm, pm2 globally  Step 1 – Add Node.js Yum Repository First of all, You need to enable node.js yum repository in your system provided by the Node.js official website. You also need development tools to build native add-ons to be installed on your system.
For Latest Release:-
yum install -y gcc-c++ make curl -sL https://rpm.nodesource.com/setup_11.x | sudo -E bash - For Stable Release:-
yum install -y gcc-c++ make curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash - Step 2 – Install Node.js and NPM After adding yum repository in your system lets install Node.js package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.
yum install nodejs Don’t Miss => Yarn Installation ( A Node Modules Manager)        Install Yarn using NPM Yarn package is available to install with NPM. You can simply run the following command to install Yarn globally. Also, remove -g option to install for current project only.
sudo npm install yarn -g Step 3 – Check Node.js and NPM Version After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.
node -v 
v11.0.0 Also, check the version of npm.
npm -v 
6.4.1



                  -------------------------- Install PM2 globally:
1)run as root(super user mode):         sudo su
2) npm i -g pm2 or if user is sudo-er
sudo npm i -g pm2 and then go back to user (or stay in root if it was created by root user) and run it:
pm2 start server.js


*******  End ****** user (hoogw) cd /../.../ permission denied   ***********************

------------------------------------------------------------------copy folder
sudo cp -a /home/transparentgov/public_html/arcgis_viewer/. /home/hoogw/arcgis_viewer
-----------*****************-----------------------
Open cpanel

Create a new mysql database
cpanel, ------ database section ------- mysql database ( NOT phpmyadmin)
You you do not want use user prefix as database name, you could do
whm, ---------- search sql service ---------- choose click  manage database
phpmyadmin
cpanel, ------ database section ----- phpmyadmin 
How to Create MySQL Databases in WHM cPanel
File manager upload file
Rename config.php 
Install the mbstring PHP Extension with EasyApache
x






-----------------------------------------------------
delete directory and subdirectory content:


 sudo rm -rf node

----------------------------



godaddy ------- cpanel ---------- whm  -------


search for list account


click cpanel next to your domain name





1)    create a new database 

2)    add transpr_root user to the newly created DB  ( must DO)




click action for the db, you want to rename, then rename it to without user prefix






select the new created db, import file, from local pc. 





https://www.youtube.com/watch?v=A3P8sa6DThA



whm ------- click file manager

public_html folder,   upload zip file.  extract .



config_windows.php
config_centOS.php





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing mbstring extention ( glassgov1, carbon forum required)


php -m | grep mbstring  [if nothing, means missing mbstring]



whm cpanel ----- search for apache,

open easy apache 4

customize currently installed packages,

click "customize" on top first line

search mbstring,  click next, next, .... privision. done


php -m | grep mbstring  [should see mbstring]

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^




Wednesday, June 13, 2018

apache port 80



1) unblock port 80:     cmd, run

netstat -ano -p tcp | findstr LISTENING
TCP    0.0.0.0:80             0.0.0.0                  LISTENING       4
TCP    0.0.0.0:445            0.0.0.0                  LISTENING       4  etc.

 if you see TCP ... 80, means some program are using port 80, you must unblock 80,
 otherwise, apache with port 80 will fail.





2)
Several programs can block that port. Candidates are:
  • Skype
  • Web Deployment Agent Service (can be stopped via Start -> [-> Run] -> services.msc)
  • World Wide Web Publishing Service
  • IIS (if you have it installed) remove all site binding with port 80
  • TeamViewer
  • VMware (in VMware Workstation go to Edit>>Preferences>>Shared VMs, and Disable Sharing or change the port)
    Web Deployment Agent Service and World Wide Web Publishing Service can be set to manual start to keep them from running. Stop or change these services from an account that has administrator permissions. Skype and TeamViewer can be configured not to use port 80. For Skype Go to Options > Advanced > Connection and un-check "Use port 80 and 443 for incoming connections" For TeamViewer Go to Extra > Options > Advanced and un-check the similar message as above.



3) disable this sql server reporting services, by click the property of service, choose start type as disable

if you installed Visual Studio, you may also have installed SQL Server. I found out that if SQL Server Reporting Services was installed and started, it uses port 80 too which was causing my problem.
Here is what I did to solve the issue:
  1. Press "Windows + R".
  2. Type: services.msc.
  3. Look for Sql Server Reporting Services in the list.
  4. If the Status reads Started, right-click on the line and click on Stop.
  5. Then, right-click on the line again and choose Properties.
  6. In the window that pops, change Startup type to Manual.
You now have stopped SQL Server Reporting Services and prevent the service from starting again on your next computer restart. Note that if you need that service to work, you will need to start it manually.


4) change port to 80 at Apache2\conf\httpd.conf


#Listen 12.34.56.78:80
Listen 80

ServerName localhost:80