• Home
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
  • CMS
    • Magento
    • Yahoo! Store

Command Line Database and user creation

Monday, 11 July 2016 12:58
Tim Ramsey
0 Comments
 
1
2
3
4
CREATE DATABASE databasename;
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON databasename.* TO 'user'@'localhost';
FLUSH PRIVILEGES;

nginx subdomain for WordPress Install

Monday, 11 July 2016 12:45
Tim Ramsey
0 Comments
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#Add A Record to Point to Server IP
cd /etc/nginx/sites-available
cat default.conf > subdomain.conf
nano subdomain.conf
 
#Wordpress subdomain.conf Contents
 
server {
    listen 80;
 
    root /var/www/html/blog;
    index index.php index.html index.htm;
 
    ###################################################
 
    server_name blog.domain.com;
 
    # WordPress single site rules.
    # Designed to be included in any server {} block.
    
    # This order might seem weird - this is attempted to match last if rules below fail.
    # http://wiki.nginx.org/HttpCoreModule
    location / {
            try_files $uri $uri/ /index.php?$args;
    }
    
    # Add trailing slash to */wp-admin requests.
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
    # Directives to send expires headers and turn off 404 error logging.
    location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
           access_log off; log_not_found off; expires max;
    }
    
    # Uncomment one of the lines below for the appropriate caching plugin (if used).
    #include global/wordpress-wp-super-cache.conf;
    #include global/wordpress-w3-total-cache.conf;
    
    # Pass all .php files onto a php-fpm/php-fcgi server.
    location ~ [^/]\.php(/|$) {
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            if (!-f $document_root$fastcgi_script_name) {
                    return 404;
            }
            # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)
    
            include fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #       fastcgi_intercept_errors on;
            fastcgi_pass 127.0.0.1:9000;
    }
 
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    
    location ~ /\. {
        deny all;
    }
    
    location ~* /(?:uploads|files)/.*\.php$ {
        deny all;
    }
}
 
#test nginx
nginx -t
 
#restart nginx
service nginx restart

Add Beanstalkd to Cpanel Centos Linux

Sunday, 08 May 2016 03:54
Tim Ramsey
0 Comments
1
2
3
4
5
#You need to have the EPEL Repo Installed = yum -y install epel-release ^ yum repolist
yum install beanstalkd
chkconfig beanstalkd on
service beanstalkd start
service beanstalkd status
I am using cPanel and added this to chkservd so to make sure that it always stays running
1
2
3
4
5
6
7
nano /etc/chkserv.d/beanstalkd
service[beanstalkd]=x,x,x,/etc/init.d/beanstalkd restart,beanstalkd,root|beanstalkd
 
#Add this line to /etc/chkserv.d/chkservd.conf
beanstalkd:1
 
#If you need to /scripts/restartsrv_tailwatchd as chkservd is now a part of tailwatch

Recover MySQL root password with root access

Sunday, 31 January 2016 17:12
Tim Ramsey
0 Comments
There are times when you lose root mysql password, but you still have root access to the server. You will probably get an error something like this:
mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Reset it with the following steps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Stop mysql service
/etc/init.d/mysql stop
 
#Start the MySQL server w/o password
mysqld_safe --skip-grant-tables &
 
#Connect to the MySQL server without password
mysql -u root
 
#Set a new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
 
#Stop mysql service
/etc/init.d/mysql stop
 
#Start mysql service
/etc/init.d/mysql start
 
#now you can login with password
mysql -u root -p

Page 7 of 11

  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • Next

Categories

  • CMS
    • Magento
    • Shopify
    • Yahoo! Store
  • Programming
    • API
      • Google
    • Javascript
    • Php
    • Server
    • SVN

Recent Posts

  • Yahoo! Store Themes Demos
  • Commision Junction and Shopify with CJEVENT
  • Use Rysnc to sync remote directory to local directory
  • M2E additional columns in grid
  • Linux commands for deleting files