Difference between revisions of "Admin:Bin"

From P&T Knowledgebase
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 20: Line 20:
 
'''Access''' For the FTP access the constants are as follows and should be added to the bottom of your wp-config.php file:
 
'''Access''' For the FTP access the constants are as follows and should be added to the bottom of your wp-config.php file:
 
  define('FTP_HOST', 'ftp.example.org');
 
  define('FTP_HOST', 'ftp.example.org');
  define('ftp_user', 'username');
+
  define('FTP_USER', 'username');
 
  define('FTP_PASS', 'password');
 
  define('FTP_PASS', 'password');
 
'''Secure Connection''' For a secure connection add the following line (default: false):
 
'''Secure Connection''' For a secure connection add the following line (default: false):
Line 44: Line 44:
 
== SQL ==
 
== SQL ==
 
=== แสดง IP Class C ที่เรามี ===
 
=== แสดง IP Class C ที่เรามี ===
  SELECT SUBSTRING_INDEX(`host_ip`, '.', 3)
+
  SELECT * FROM
  FROM `lnw_lnwhost__hosts`
+
`lnw_lnwhost__host_resellers`
  LEFT JOIN `lnw_lnwhost__host_resellers` USING (`host_reseller_id`)
+
  WHERE
  WHERE `host_ip` IS NOT NULL
+
  `username`='pathosting' AND
 +
  `host_ip` IS NOT NULL
 
  GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)
 
  GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)
 +
=== แสดง IP Class C ที่เรามี พร้อมส่งให้ลูกค้า ===
 +
https://www.pathosting.co.th/admin/search/custom_query?select_query=SELECT+CONCAT%28SUBSTRING_INDEX%28`host_ip`%2C+%27.%27%2C+3%29%2C%22.x%22%29%2Cconcat%28count%28*%29%2C%22+IPs%22%29+FROM%0D%0A`pat21_lnwhost__host_resellers`%0D%0AWHERE+%0D%0A`username`%3D%27pathosting%27+AND%0D%0A`host_ip`+IS+NOT+NULL%0D%0AGROUP+BY+SUBSTRING_INDEX%28`host_ip`%2C+%27.%27%2C+3%29
 
=== หา IP Class C ที่ยังไม่ได้ใช้ (สำหรับโฮสติ้ง) ===
 
=== หา IP Class C ที่ยังไม่ได้ใช้ (สำหรับโฮสติ้ง) ===
 
เวลาเอาไปใช้ เปลี่ยนตรง WHERE `user_id`=...
 
เวลาเอาไปใช้ เปลี่ยนตรง WHERE `user_id`=...
Line 64: Line 67:
 
  GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)
 
  GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)
 
  )
 
  )
 +
=== หา IP ที่ไม่ซ้ำของเก่า ===
 +
SELECT  `host_reseller_id` ,  `host_ip`
 +
FROM  `lnw_lnwhost__host_resellers`
 +
WHERE  `username` =  'pathosting'
 +
AND  `host_ip` NOT
 +
IN (
 +
  SELECT  `host_ip`
 +
  FROM  `lnw_lnwhost__hosts`
 +
  LEFT JOIN  `lnw_lnwhost__host_resellers`
 +
  USING (  `host_reseller_id` )
 +
  WHERE  `user_id` =43954
 +
  GROUP BY  `host_ip`
 +
)
 +
LIMIT 0 , 30
 +
 
เวลาเอาใส่ order.extra
 
เวลาเอาใส่ order.extra
 
  '''{"REQHRESELLID":1}'''
 
  '''{"REQHRESELLID":1}'''
Line 89: Line 107:
 
=== THAIMALLPLAZA MONTHLY SUMMARY ===
 
=== THAIMALLPLAZA MONTHLY SUMMARY ===
 
สรุปรายการโดเมนของ Thaimallplaza ในเดือนที่ผ่านมา
 
สรุปรายการโดเมนของ Thaimallplaza ในเดือนที่ผ่านมา
  https://www.pathosting.co.th/admin/search/custom_query?select_query=SELECT+%0D%0ACONCAT(%0D%0ACASE+`domain_service`%0D%0AWHEN+'register'+THEN+'%E0%B8%88%E0%B8%94%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'renew'+THEN+'%E0%B8%95%E0%B9%88%E0%B8%AD%E0%B8%AD%E0%B8%B2%E0%B8%A2%E0%B8%B8%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'transfer'+THEN+'%E0%B8%A2%E0%B9%89%E0%B8%B2%E0%B8%A2%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AEND,'+',+`domain_name`,'+',`domain_period`,'+%E0%B8%9B%E0%B8%B5','+(',`domain_begin_date`,'+%E0%B8%96%E0%B8%B6%E0%B8%87+',`domain_end_date`,')')+AS+`%E0%B8%A3%E0%B8%B2%E0%B8%A2%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*100,2)+AS+`%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%9A%E0%B8%A3%E0%B8%B4%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*3,2)+AS+`%E0%B8%88%E0%B8%B3%E0%B8%99%E0%B8%A7%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B5%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%AB%E0%B8%B1%E0%B8%81%E0%B9%84%E0%B8%A7%E0%B9%89`,%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+AS+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`%0D%0AFROM+`lnw_lnwhost__orders`%0D%0AWHERE%0D%0A`user_id`%3D36706+AND%0D%0A`status`%3D'complete'+AND%0D%0A(`domain_price`%2B`host_price`%2B`other_price`%3E0+OR+`domain_period`%2B`host_period`%3E0)+AND%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+BETWEEN+DATE_FORMAT(NOW()+-+INTERVAL+1+MONTH,+'%25Y-%25m-01')+AND+LAST_DAY(NOW()+-+INTERVAL+1+MONTH)%0D%0AORDER+BY+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`
+
  https://www.pathosting.co.th/admin/search/custom_query?select_query=SELECT+%0D%0ACONCAT(%0D%0ACASE+`domain_service`%0D%0AWHEN+'register'+THEN+'%E0%B8%88%E0%B8%94%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'renew'+THEN+'%E0%B8%95%E0%B9%88%E0%B8%AD%E0%B8%AD%E0%B8%B2%E0%B8%A2%E0%B8%B8%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'transfer'+THEN+'%E0%B8%A2%E0%B9%89%E0%B8%B2%E0%B8%A2%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AEND,'+',+`domain_name`,'+',`domain_period`,'+%E0%B8%9B%E0%B8%B5','+(',`domain_begin_date`,'+%E0%B8%96%E0%B8%B6%E0%B8%87+',`domain_end_date`,')')+AS+`%E0%B8%A3%E0%B8%B2%E0%B8%A2%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*100,2)+AS+`%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%9A%E0%B8%A3%E0%B8%B4%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*3,2)+AS+`%E0%B8%88%E0%B8%B3%E0%B8%99%E0%B8%A7%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B5%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%AB%E0%B8%B1%E0%B8%81%E0%B9%84%E0%B8%A7%E0%B9%89`,%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+AS+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`%0D%0AFROM+`lnw_lnwhost__orders`%0D%0AWHERE%0D%0A`user_id`%3D36706+AND%0D%0A`status`%3D'complete'+AND%0D%0A`wht`%3E0+AND%0D%0A(`domain_price`%2B`host_price`%2B`other_price`%3E0+OR+`domain_period`%2B`host_period`%3E0)+AND%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+BETWEEN+DATE_FORMAT(NOW()+-+INTERVAL+1+MONTH,+'%25Y-%25m-01')+AND+LAST_DAY(NOW()+-+INTERVAL+1+MONTH)%0D%0AORDER+BY+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`
  
 
== DirectAdmin ==
 
== DirectAdmin ==

Latest revision as of 11:47, 30 March 2011

คำสั่ง start httpd ขั้นเทพ

* ในกรณีที่ start httpd ไม่ขึ้น

/usr/bin/ipcrm sem $(/usr/bin/ipcs -s | grep apache | awk '{print$2}')
/etc/init.d/httpd restart

MySQL Dump

mysqldump --user {username} --password={password} {dbname} > filename.sql
mysql --user {username} --password={password} {dbname} < filename.sql

URL

CMS

Wordpress

ตั้งโดเมนที่ใช้กับ Wordpress

เวลาเปลี่ยนโดเมนที่ใช้กับ Wordpress จะทำให้เข้า WP-ADMIN ไม่ได้ ทำให้เข้าไปตั้ง Site URL หรือ Blog URL เนี่ยแหละ เข้าไปตั้งไม่ได้ วิธีการแก้ไข คือ ให้ไป define constant เพิ่มใน wp-config.php ดังนี้

define("WP_HOME","http://www.example.com");
define("WP_SITEURL","http://www.example.com");

ใส่ FTP INFO ใน wp-config.php

Access For the FTP access the constants are as follows and should be added to the bottom of your wp-config.php file:

define('FTP_HOST', 'ftp.example.org');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');

Secure Connection For a secure connection add the following line (default: false):

define('FTP_SSL', true);

Directories If the WordPress installation is not in the root directory of the FTP server you can define the location as follows:

define(FTP_BASE','...');

Have you moved the plugin directory or all of the content folder? You can also specify the full path using these two constants:

define('FTP_CONTENT_DIR', '...');
define('FTP_PLUGIN_DIR', '...');

Method Finally, you can also adjust the method to be used by WordPress for the file system. This often hides errors if something goes wrong with the file permissions. You should only change this value if errors occur, most of the time the default will work just fine.

define('FS_METHOD', 'direct');

The following methods are possible:

  • direct (default) - PHP file system functions
  • ssh - SSH PHP Extension
  • ftpext - FTP PHP Extension
  • ftpsockets - PHP socket extension

For more information Click Here

Joomla

Check Version Joomla

grep var libraries/joomla/version.php

SQL

แสดง IP Class C ที่เรามี

SELECT * FROM
`lnw_lnwhost__host_resellers`
WHERE 
`username`='pathosting' AND
`host_ip` IS NOT NULL
GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)

แสดง IP Class C ที่เรามี พร้อมส่งให้ลูกค้า

https://www.pathosting.co.th/admin/search/custom_query?select_query=SELECT+CONCAT%28SUBSTRING_INDEX%28`host_ip`%2C+%27.%27%2C+3%29%2C%22.x%22%29%2Cconcat%28count%28*%29%2C%22+IPs%22%29+FROM%0D%0A`pat21_lnwhost__host_resellers`%0D%0AWHERE+%0D%0A`username`%3D%27pathosting%27+AND%0D%0A`host_ip`+IS+NOT+NULL%0D%0AGROUP+BY+SUBSTRING_INDEX%28`host_ip`%2C+%27.%27%2C+3%29

หา IP Class C ที่ยังไม่ได้ใช้ (สำหรับโฮสติ้ง)

เวลาเอาไปใช้ เปลี่ยนตรง WHERE `user_id`=...

SELECT 
`host_reseller_id`, SUBSTRING_INDEX(`host_ip`, '.', 3) , `host_ip` 
FROM `lnw_lnwhost__host_resellers`
WHERE 
`username`='pathosting' AND
SUBSTRING_INDEX(`host_ip`, '.', 3) NOT IN (
SELECT 
SUBSTRING_INDEX(`host_ip`, '.', 3)
FROM `lnw_lnwhost__hosts` 
LEFT JOIN `lnw_lnwhost__host_resellers` USING (`host_reseller_id`)
WHERE `user_id`=37111
GROUP BY SUBSTRING_INDEX(`host_ip`, '.', 3)
)

หา IP ที่ไม่ซ้ำของเก่า

SELECT  `host_reseller_id` ,  `host_ip` 
FROM  `lnw_lnwhost__host_resellers` 
WHERE  `username` =  'pathosting'
AND  `host_ip` NOT 
IN (
 SELECT  `host_ip` 
 FROM  `lnw_lnwhost__hosts` 
 LEFT JOIN  `lnw_lnwhost__host_resellers` 
 USING (  `host_reseller_id` ) 
 WHERE  `user_id` =43954
 GROUP BY  `host_ip`
)
LIMIT 0 , 30

เวลาเอาใส่ order.extra

{"REQHRESELLID":1}

หา IP Class C ที่ยังไม่ได้ใช้ (แปลกๆ)

SELECT * FROM `lnw_lnwhost__host_servers_ips` 
WHERE 
`parent_ip` NOT LIKE  AND
substring(`ip`,1,9) NOT IN (
'61.19.247',
'61.19.250',
'61.19.246',
'122.155.5',
'122.155.5',
'122.155.5',
'61.19.246',
'61.19.250',
'61.19.247',
'61.19.247',
'61.19.246',
'61.19.250',
'122.155.5') 
AND 
`ns1` LIKE 'NS%.PATHOSTING.COM'
GROUP BY substring(`ip`,1,9)

THAIMALLPLAZA MONTHLY SUMMARY

สรุปรายการโดเมนของ Thaimallplaza ในเดือนที่ผ่านมา

https://www.pathosting.co.th/admin/search/custom_query?select_query=SELECT+%0D%0ACONCAT(%0D%0ACASE+`domain_service`%0D%0AWHEN+'register'+THEN+'%E0%B8%88%E0%B8%94%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'renew'+THEN+'%E0%B8%95%E0%B9%88%E0%B8%AD%E0%B8%AD%E0%B8%B2%E0%B8%A2%E0%B8%B8%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AWHEN+'transfer'+THEN+'%E0%B8%A2%E0%B9%89%E0%B8%B2%E0%B8%A2%E0%B9%82%E0%B8%94%E0%B9%80%E0%B8%A1%E0%B8%99%E0%B9%80%E0%B8%99%E0%B8%A1'%0D%0AEND,'+',+`domain_name`,'+',`domain_period`,'+%E0%B8%9B%E0%B8%B5','+(',`domain_begin_date`,'+%E0%B8%96%E0%B8%B6%E0%B8%87+',`domain_end_date`,')')+AS+`%E0%B8%A3%E0%B8%B2%E0%B8%A2%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*100,2)+AS+`%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%9A%E0%B8%A3%E0%B8%B4%E0%B8%81%E0%B8%B2%E0%B8%A3`,%0D%0AROUND((domain_price%2Bhost_price%2Bother_price)/(100%2Bvat)*3,2)+AS+`%E0%B8%88%E0%B8%B3%E0%B8%99%E0%B8%A7%E0%B8%99%E0%B8%A0%E0%B8%B2%E0%B8%A9%E0%B8%B5%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%AB%E0%B8%B1%E0%B8%81%E0%B9%84%E0%B8%A7%E0%B9%89`,%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+AS+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`%0D%0AFROM+`lnw_lnwhost__orders`%0D%0AWHERE%0D%0A`user_id`%3D36706+AND%0D%0A`status`%3D'complete'+AND%0D%0A`wht`%3E0+AND%0D%0A(`domain_price`%2B`host_price`%2B`other_price`%3E0+OR+`domain_period`%2B`host_period`%3E0)+AND%0D%0AIF(`payment_date`%3D'0000-00-00',+`pay_by_fund_date`,+`payment_date`)+BETWEEN+DATE_FORMAT(NOW()+-+INTERVAL+1+MONTH,+'%25Y-%25m-01')+AND+LAST_DAY(NOW()+-+INTERVAL+1+MONTH)%0D%0AORDER+BY+`%E0%B8%A7%E0%B8%B1%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B9%88%E0%B8%B2%E0%B8%A2`

DirectAdmin

Manual edit User/Reseller

  • แก้ที่ไฟล์ /usr/local/directadmin/data/users/reseller/users.list
    • ลบออกจาก reseller เดิม
    • เพิ่มที่ reseller ใหม่
  • แก้ไฟล์ /usr/local/directadmin/data/users/username/user.conf , แก้บรรทัด creator=
  • รันคำสั่ง
    echo "action=cache&value=showallusers" >> /usr/local/directadmin/data/task.queue