kieranbarnes Independent PHP, WordPress & CubeCart Programmer

MySQL: Can’t get hostname for your address

Posted on October 28, 2010

Posted by Kieran

Can''t remotely login to your shiney, new MySQL server due “Can’t get hostname for your address” or "Can't get hostname for your address". Another random MySQL error message.

Simply put, if you look in the logs, MySQL cannot lookup your IP/hostname. Its that simple.

Is your DNS broke? Or just on a Local Area Network with no DNS anyway?
Just add skip-name-resolve option to the [mysqld] section of your my.cnf/my.ini

Imitation is flattery.

Posted on October 11, 2010

Posted by Kieran

Thats all.

Filed under: General No Comments

[Snippet] Create a large file in Linux

Posted on August 21, 2010

Posted by Kieran

Need to create a large file? For disk speed tests? Or space tests?

  1. dd if=/dev/zero of=your.big.file bs=1MB count=500

This will create a 500Mb file in your current directory called  your.big.file

  1. 500+0 records in
  2. 500+0 records out
  3. 500000000 bytes (500 MB) copied, 4.08855 seconds, 122 MB/s
Tagged as: , 1 Comment

[Snippet] Skipping the WHM Getting Started Wizard

Posted on August 17, 2010

Posted by Kieran

WHM uses the /etc/.whostmgrft file to determine whether the Getting Started Wizard should run. You can touch the file using the following command to stop it appearing

touch /etc/.whostmgrft

Smarty Security – Stop .tpl access

Posted on August 17, 2010

Posted by Kieran

WHMCS uses the Smarty template engine. Which means your .tpl files are accessible to anyone that knows the path. Quite easy in WHMCS. Whilst not really a major security risk, its bad practise to all these files to be accessed directly.

Add this code into your .htaccess file.

  1. <Files ~ "\.tpl$">
  2. Order allow,deny
  3. Deny from all
  4. </Files>
Tagged as: No Comments

New Roll Cage

Posted on August 13, 2010

Posted by Kieran

Out came the dash dodging bolt in to make way for the weld in.

Theres a lot of work before it goes in. Etch primering, painting laquering and a bit of seem welding.

Filed under: Vantegra No Comments

Active Directory DHCP Authorisation Issues

Posted on August 6, 2010

Posted by Kieran

So you just deleted a DHCP server in your Active Directory site and can't authorise a new one? Yeah... Stupid.

A client of mine recently deleted a Windows Server running DHCP and couldn't authorise the new server of the same name.
This is because the client did not Unauthorise the server beforehand. Possibly because the server hardware was dead.

[Snippet] Forcing Replication Between Domain Controllers

Posted on August 5, 2010

Posted by Kieran

...because some people still don't know!

  1. Open Active Directory Sites and Services.
  2. In the console tree, expand Sites, and then expand the site to which you want to force replication from the updated server.
  3. Expand the Servers container to display the list of servers that are currently configured for that site.
  4. Expand the server objects and click their NTDS Settings objects to display their connection objects in the details pane. Find a server that has a connection object from the server on which you made the updates.
  5. Click NTDS Settings below the server object. In the details pane, right-click the connection object whose From Server is the domain controller that has the updates that you want to replicate, and then click Replicate Now.
  6. When the Replicate Now message box appears, review the information, and then click OK.

That is all!

Tagged as: , No Comments

[Snippet] Stupid Simple cPanel Install

Posted on August 3, 2010

Posted by Kieran

Open a clean server,

  1. cd /home && wget -N http://httpupdate.cpanel.net/latest && sh latest && /usr/local/cpanel/cpkeyclt

Go have your lunch. Maybe lunch +VAT depending on the speed of your server.

Tagged as: No Comments

cPanel MySQL Tuning

Posted on August 3, 2010

Posted by Kieran

The default configuration for MySQL provided by cPanel is pretty barren. /etc/my.cnf

  1. [mysqld] skip-innodb

Thats it. One line. Its rubbish.

Here's mine to help you along the way. Its got some decent logging set, some decent cache and memory options for a shared server set and some helpful security settings enabled.

  1. [mysqld]
  2. max_connections = 200
  3. bind-address = 127.0.0.1
  4.  
  5. safe-show-database
  6. skip-locking
  7. skip-innodb
  8.  
  9. # MySQL 4.x has query caching available.
  10. # Enable it for vast improvement and it may be all you need to tweak.
  11. query_cache_type=1
  12. query_cache_limit=1M
  13. query_cache_size=32M
  14.  
  15. interactive_timeout=100
  16.  
  17. # Reduced wait_timeout to prevent idle clients holding connections.
  18. wait_timeout=15
  19. connect_timeout=10
  20.  
  21. # Checked opened tables and adjusted accordingly after running for a while.
  22. table_cache=512
  23.  
  24. # Reduced it to 32 to prevent memory hogging.
  25. thread_cache=32
  26.  
  27. # Reduced it by checking current size of *.MYI files.
  28. key_buffer=128M
  29.  
  30. thread_concurrency=1
  31.  
  32. log_error = /var/log/mysql/error.log
  33.  
  34. # log slow queries is a must.
  35. log_slow_queries=/var/log/mysqld.slow.log
  36. long_query_time=2
  37.  
  38. [mysqldump]
  39. quick
  40. max_allowed_packet=16M
  41.  
  42. [mysql]
  43. no-auto-rehash
  44.  
  45. [isamchk]
  46. key_buffer=64M
  47. sort_buffer=64M
  48. read_buffer=16M
  49. write_buffer=16M
  50.  
  51. [myisamchk]
  52. key_buffer=64M
  53. sort_buffer=64M
  54. read_buffer=16M
  55. write_buffer=16M
  56.  
  57. [mysqlhotcopy]
  58. interactive-timeout
Tagged as: , No Comments
Page 14 of 35« First...1213141516...2030...Last »